mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-11-19 23:06:12 +00:00
Surface output-limit truncation instead of misformat retries
Record the Chat Completions finish_reason on LLMResult and add a message_loop_result extension that, when a turn stopped at the output token limit (finish_reason "length"/"max_tokens") without a complete tool request, retries with a warning naming truncation as the cause rather than the generic misformat message. The warning counts toward the existing unusable-response loop limit. Context Doctor now leaves results already handled by an earlier extension untouched, so truncated envelopes are not repaired and dispatched with cut-off arguments. Fixes #1836
This commit is contained in:
parent
ff2a5b9c9c
commit
2f8a06515e
17 changed files with 166 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ class StopUnusableResponseLoop(Extension):
|
|||
self.agent.read_prompt("fw.msg_empty_response.md"),
|
||||
self.agent.read_prompt("fw.msg_reasoning_only.md"),
|
||||
self.agent.read_prompt("fw.msg_thoughts_fallback.md"),
|
||||
self.agent.read_prompt("fw.msg_output_limit.md"),
|
||||
}:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue