agent-zero/plugins/_context_doctor
linkliti 60073f283a Add LLMResult.non_llm sentinel and apply frdel review findings
Add LLMResult.non_llm classmethod for non-LLM AI turns (greeting, intervention progress) so stored metadata does not claim a Responses-API turn. Rename is_thoughts_fallback to looks_like_tool_call (inverted polarity: True when valid A0 response JSON). Rework check to accept any dict containing at least one A0 key (thoughts/headline/tool_name/tool_args); empty dicts and non-A0 dicts fall through to the raw-text fallback branch. Fix drawMessageAgent kvps order to thoughts, tool_name, tool_args keys (reserved keys skipped), then step; reserved keys (thoughts, step, reasoning, tool_name, tool_args, args, headline) win over colliding tool_args keys. Document Hello! seeding turns as few-shot example, drawMessageDefault as deprecated, and plugin get_log_object duplication as intentional. Align context_doctor DOX kvps sentence with code (reasoning only, not thoughts).
2026-09-04 17:44:40 +03:00
..
extensions/python Add LLMResult.non_llm sentinel and apply frdel review findings 2026-09-04 17:44:40 +03:00
helpers Add LLMResult.non_llm sentinel and apply frdel review findings 2026-09-04 17:44:40 +03:00
prompts Handle reasoning-only and plain-text fallback responses 2026-09-03 03:37:59 +03:00
tests Add LLMResult.non_llm sentinel and apply frdel review findings 2026-09-04 17:44:40 +03:00
webui Add split-thoughts repair strategy to context doctor 2026-09-03 03:53:38 +03:00
AGENTS.md Add LLMResult.non_llm sentinel and apply frdel review findings 2026-09-04 17:44:40 +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.