mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-10-14 03:38:53 +00:00
Leave canonical function calls and their accompanying text untouched by text repair. Otherwise a valid native call with plain-text output can enter the fallback branch and skip normal tool dispatch. Apply this to both Responses and Chat Completions while retaining the existing execution policy gate and text-only repair behavior. Cover plain text, XML-like output, and a textual second call, including metadata preservation and single native dispatch. Update the plugin contract. All 144 focused tests pass; two live Codex OAuth terminal tasks completed with final cache hits of 77% and 76% in the context viewer. |
||
|---|---|---|
| .. | ||
| extensions/python | ||
| helpers | ||
| prompts | ||
| tests | ||
| webui | ||
| AGENTS.md | ||
| default_config.yaml | ||
| hooks.py | ||
| plugin.yaml | ||
| README.md | ||
Context Doctor
Repairs model tool call JSON before sending it to history and tool processing.
Behavior
- Uses
json_repairafter native parsing has completed. - Accepts only complete Agent Zero tool calls (
tool_nameand objecttool_args). - 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.
- Optionally replaces XML-like output with
{}in cases where model uses native XML tool calls.