agent-zero/plugins/_context_doctor
linkliti 093b9106ef Tighten context doctor usable-response detection
Guard empty/whitespace LLM responses so context_doctor defers to _20_empty_response instead of polluting history with {thoughts:[]}. Require looks_like_tool_call to find at least one A0 key with a usable non-empty value (non-empty list of non-empty strings for thoughts, non-empty string for headline/tool_name, non-empty dict for tool_args). Update AGENTS.md contract and add regression tests for empty/blank/wrong-type rejections.
2026-09-04 18:33:01 +03:00
..
extensions/python Tighten context doctor usable-response detection 2026-09-04 18:33:01 +03:00
helpers Tighten context doctor usable-response detection 2026-09-04 18:33:01 +03:00
prompts Handle reasoning-only and plain-text fallback responses 2026-09-03 03:37:59 +03:00
tests Tighten context doctor usable-response detection 2026-09-04 18:33:01 +03:00
webui Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
AGENTS.md Tighten context doctor usable-response detection 2026-09-04 18:33:01 +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.