agent-zero/plugins/_context_doctor
linkliti fb84e46c69 Add split-thoughts repair strategy to context doctor
Extracts value selection into _select_value helper, mutates _split_thoughts in place, and applies the split once after repair. Adds a split_thoughts config (default on) with a Strategies section in the plugin settings UI, regression tests for blank-line splitting in repaired JSON, raw-text fallback, and disabled mode. Keeps reasoning-only kvps retention and the raw-text fallback claim path.
2026-09-03 03:53:38 +03:00
..
extensions/python Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
helpers Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
prompts Handle reasoning-only and plain-text fallback responses 2026-09-03 03:37:59 +03:00
tests Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
webui Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
AGENTS.md Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +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 Add Context Doctor plugin 2026-08-24 19:51:30 +03:00
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.