agent-zero/plugins/_context_doctor
linkliti 19da9a07e3 Own fallback turn retry in Context Doctor
Context Doctor now persists the transformed thoughts JSON via hist_add_ai_response before emitting the fallback warning, matching the RepeatResponse retry pattern. Simplify is_thoughts_fallback to check tool_name absence so split multi-paragraph and native thoughts JSON are detected. Remove the core stop-unusable-response-loop counter for plugin-owned fallback warnings. Delete unreachable skip_default_processing block after the early fallback return.
2026-09-04 00:20:43 +03:00
..
extensions/python Own fallback turn retry in Context Doctor 2026-09-04 00:20:43 +03:00
helpers Own fallback turn retry in Context Doctor 2026-09-04 00:20:43 +03:00
prompts Handle reasoning-only and plain-text fallback responses 2026-09-03 03:37:59 +03:00
tests Own fallback turn retry in Context Doctor 2026-09-04 00:20:43 +03:00
webui Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
AGENTS.md Own fallback turn retry in Context Doctor 2026-09-04 00:20:43 +03:00
default_config.yaml Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
hooks.py Install Context Doctor dependency after self-update 2026-08-25 23:40:31 +02:00
plugin.yaml
README.md Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00

Context Doctor

Repairs model tool call JSON before sending it to history and tool processing.

Behavior

  • Uses json_repair after native parsing has completed.
  • Accepts only complete Agent Zero tool calls (tool_name and object tool_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.