Commit Graph
12 Commits
Author SHA1 Message Date
Alessandro 039efe4198 Keep model prose as thoughts and retry silently
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.
2026-11-01 06:50:49 +01:00
linkliti ebac0eb836 fix(ui): drop agent prefix from warning log rows
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
2026-10-21 23:37:32 +03:00
Alessandro 675e7d051d Guard truncated native calls and preserve stream finish metadata
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.
2026-10-13 20:50:30 +02:00
Mohammad Hijjawi 2f8a06515e Surface output-limit truncation instead of misformat retries
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
2026-10-13 19:38:05 +02:00
Alessandro 27b7df8917 Restore full-response repeat checks for native tool calls
Compare public commentary together with canonical function calls when
recording and checking the previous response. This restores the historical
full-message policy for native turns, so changed or missing commentary
can distinguish otherwise identical calls.

Keep canonical call history, masking, provider metadata and state
advancement intact. Exclude provider IDs and separate reasoning from the
comparison; identical public text and calls remain guarded.

Cover commentary changes and absence, call changes and batches, provider
metadata round trips, and legacy thoughts/headline behavior. Update the
owning contracts. Verified with 177 passing tests, four recorded Mac
warning replays and a live two-call drill using the Codex II preset.
2026-10-06 18:49:30 +02:00
Alessandro 5602d5c4be Preserve native calls in assistant history and repeat checks
Store canonical function-call content through the existing assistant history and masking path, preserving original provider metadata. Compare that same content when detecting repeated responses so accompanying commentary cannot hide distinct calls.

Validated with 87 focused architecture, result, logging and Context Doctor tests plus a framework runtime history/repeat probe. Native history replay remains a separate change.
2026-09-06 20:10:46 +02:00
linkliti 0bd5f34848 Handle reasoning-only and plain-text fallback responses
Reasoning-only turns now retry with an agent-facing fw.msg_reasoning_only.md history warning and a separate fw.msg_reasoning_only_response.md user notice, counted by the stop-unusable-response-loop extension instead of falling through to the unclear misformat path. Context Doctor detects raw-text fallback conversions and claims the turn with fw.msg_thoughts_fallback.md agent warning and fw.msg_thoughts_fallback_response.md user notice, also counted by the stop loop. Both cases set skip_default_processing so the model gets a clear retry instruction.
2026-09-03 03:37:59 +03:00
linkliti ade1489790 Count empty responses toward unusable-response limit
Track consecutive empty model responses in the empty-response handler so the agent stops once the configured unusable-response limit is reached, matching repeat and misformat recovery. Log the empty-response warning for under-limit iterations and switch to the framework limit warning when the loop is forced to stop.
2026-08-25 02:54:56 +00:00
linkliti 84ed5bfb5c Keep empty response warnings out of history
Log empty-response retries without adding a warning message to model context.
2026-08-24 22:47:44 +03:00
linkliti dbbdd26cc5 Split unusable response loop control
Handle empty model responses and repeated response content in separate message-loop result extensions. Move the repeat retry log text into a framework prompt.

Cover empty-response logging and repeated content with reasoning.
2026-08-24 22:07:11 +03:00
linkliti eaeec455e2 Preserve Unicode in streamed Responses output
Keep synthesized Responses tool-call JSON readable in raw LLM log details and show a concise agent-prefixed repeat warning in the WebUI.

Cover streamed Cyrillic function-call arguments and repeat-warning display.
2026-08-24 20:11:30 +03:00
linkliti fd30f33d52 Add result extension point and migrate repeat handling
Let extensions normalize or consume each completed model result before default history and tool processing. Move repeat detection into loop control and add a dedicated empty-response warning so one turn produces one UI warning.
2026-08-24 19:51:30 +03:00