agents: always use API backend, remove tools field from .agent files
- Remove is_split special case in daemon — split now goes through job_consolidation_agent like all other agents - call_for_def uses API whenever api_base_url is configured, regardless of tools field (was requiring non-empty tools to use API) - Remove "tools" field from all .agent files — memory tools are always provided by the API layer, not configured per-agent - Add prompt size guard: reject prompts over 800KB (~200K tokens) with clear error instead of hitting the model's context limit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9d476841b8
commit
6069efb7fc
9 changed files with 17 additions and 31 deletions
|
|
@ -138,6 +138,16 @@ fn run_one_agent_inner(
|
|||
else { format!("{} tools", def.tools.len()) };
|
||||
log(&format!("prompt {}KB, model={}, {}, {} nodes",
|
||||
prompt_kb, def.model, tools_desc, agent_batch.node_keys.len()));
|
||||
|
||||
// Guard: reject prompts that would exceed model context.
|
||||
// Rough estimate: 1 token ≈ 4 bytes. Reserve 16K tokens for output.
|
||||
let max_prompt_bytes = 800_000; // ~200K tokens, leaves room for output
|
||||
if agent_batch.prompt.len() > max_prompt_bytes {
|
||||
return Err(format!(
|
||||
"prompt too large: {}KB (max {}KB) — seed nodes may be oversized",
|
||||
prompt_kb, max_prompt_bytes / 1024,
|
||||
));
|
||||
}
|
||||
for key in &agent_batch.node_keys {
|
||||
log(&format!(" node: {}", key));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue