mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-12-04 01:18:39 +00:00
Preserve free text and reasoning-only output in the current generation and retry without intermediate warning rows. Require an explicit response tool call to finish in both API modes, including after provider built-in actions. Keep history metadata, Responses state, tool validation and the consecutive-failure stop intact. Allow core retries when Context Doctor and its prompts are unavailable. Validation: 411 backend tests and 2 Chromium live/replay grouping tests passed; live runtime health check passed.
Context Doctor
Repairs model tool call JSON before sending it to history and tool processing.
Behavior
- Uses
json_repairon completed model output, including missing brackets, braces and unfinished arguments. - Selects a repaired Agent Zero tool call (
tool_nameand objecttool_args) or preserves model-authored thoughts and headlines. - Stores repaired tool calls as compact JSON; log kvps retain streamed reasoning and add transformed fields.
- Expands blank-line-separated thoughts into separate entries after repair when the split strategy is enabled.
- Core first attempts conversion of complete alternate-format XML/DSML/native calls. Unconverted text still reaches Context Doctor's normal repair path.
- With Update log content off (default), View Details keeps the original model output, including recovered XML/DSML. Turn it on to show repaired JSON instead. Recovery notices use the UTL badge and follow Show utility messages.
- When no valid tool call is present, prose in either API mode and model-authored thoughts/headlines stay in the current generation as thoughts. The agent retries silently with an internal tool-call reminder; only an explicit response-tool call delivers the final answer. Unusable XML-like output is suppressed by default; turning suppression off keeps it as thoughts. The configured consecutive-failure limit still stops recovery with a visible notice.
- Repaired calls use normal tool dispatch and permissions. Native transport calls and earlier output-limit handling retain their existing paths.