Preserve free text and reasoning-only output in the current generation
and retry without intermediate warning rows. Require an explicit response
tool call to finish in both API modes, including after provider built-in
actions.
Keep history metadata, Responses state, tool validation and the
consecutive-failure stop intact. Allow core retries when Context Doctor
and its prompts are unavailable.
Validation: 411 backend tests and 2 Chromium live/replay grouping tests
passed; live runtime health check passed.
Framework warning log rows no longer repeat the agent name before the message text, covering tool and execution errors, the misformat notice, and the truncated, empty, repeat and fallback response warnings. A source-level regression test keeps the warning rows prefix-free, and the message-loop and context-doctor DOX and tests stop expecting the removed prefix.
Validation: pytest tests/test_warning_log_prefixes.py tests/test_tool_action_contracts.py tests/test_message_loop_result.py plugins/_context_doctor/tests/test_context_doctor.py
Reject incomplete native-call argument JSON during output-limit recovery
while allowing complete calls to proceed. Publish observed finish reasons
and canonical calls before terminal or flushed stream output reaches
callbacks, so early cancellation preserves the original result metadata.
Cover sync and async installed-SDK streams, callback stops, incomplete and
mixed native-call batches, and result/history metadata compatibility.
Update the owning extension and transport documentation.
Validation: 327 focused tests passed in the Docker framework runtime;
333 tests and 11 subtests passed in the updated local environment.
Live localhost:32081 checks passed with Codex Responses and Opus Chat
Completions through the Agent Zero LLM API. A real 64-token Opus cutoff
produced the dedicated length warning and recovered in one retry.
Record the Chat Completions finish_reason on LLMResult and add a
message_loop_result extension that, when a turn stopped at the output
token limit (finish_reason "length"/"max_tokens") without a complete
tool request, retries with a warning naming truncation as the cause
rather than the generic misformat message. The warning counts toward
the existing unusable-response loop limit.
Context Doctor now leaves results already handled by an earlier
extension untouched, so truncated envelopes are not repaired and
dispatched with cut-off arguments.
Fixes#1836