Commit Graph
7 Commits
Author SHA1 Message Date
DarkPhilosophy ad444f652c fix(coding-agent): retry orphaned toolUse stops to prevent history corruption
When Anthropic Claude returns stopReason: "toolUse" but the assistant
message contains no actual toolCall, the session would append a spurious
toolResult entry. This creates tool_result blocks without matching
tool_use blocks — structurally invalid for Anthropic's API validator.

The symptom is overloaded_error on every subsequent request (in: 0 out: 0),
even though servers aren't overloaded. Other providers handle the same
corrupted history more leniently, making the problem appear Anthropic-specific.

The #isEmptyAssistantStop guard now checks for stopReason === "toolUse"
with no text and no toolCall. When the retry cap is hit, tool-use orphans
are still removed from active context (unlike regular empty stops) because
they corrupt message history. A regression test covers both the retry and
cap scenarios.

For affected sessions: run /compact to drop the corrupted history tail.

Fixes review feedback from chatgpt-codex-connector.
2026-06-05 21:15:42 +03:00
can1357 5038ad7855 tests: delete/adjust brittle tests 2026-06-04 17:46:00 +02:00
can1357 51865fc1ea test(coding-agent): updated assertions for condensed prompt wording
- Aligned handoff, reminder, and system-prompt expectations with shortened copy.
- Added HTTP transport test for required initialize failures.
- Guarded SSE startup timeout against stale connection races.
2026-06-04 16:35:45 +02:00
SuperHedge a36e7d6192 fix(coding-agent): reset retry state on empty-stop cap 2026-06-01 09:35:20 +02:00
SuperHedge 49e029b33f fix(coding-agent): preserve retry state on empty stops 2026-06-01 09:35:20 +02:00
SuperHedge 23c339f6da Resolve empty-stop retry cap waits 2026-06-01 09:35:20 +02:00
SuperHedge 528f4c197b Guard empty assistant stops during active tasks 2026-06-01 09:35:20 +02:00