Repository navigation
fix: Anthropic refusals no longer resend requests - #134980
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed September 1, 2026, 12:13 PM ET / 16:13 UTC. ClawSweeper reviewWhat this changesThe PR makes structured provider refusals terminal across retry, compaction, credential rotation, model fallback, and safe user-facing error delivery. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open: the terminality repair is well-covered, but the delivered refusal still gives no recovery action after retries and configured fallback are intentionally disabled. Priority: P2 Review scores
Verification
How this fits togetherThe embedded agent runner receives an assistant response from a provider, determines whether it is terminal, then either retries/recovers or delivers an error. This change prevents a structured provider refusal from being mistaken for an empty transient response. flowchart LR
A[Provider response] --> B[Refusal diagnostic]
B --> C[Embedded agent runner]
C --> D{Terminal outcome?}
D -->|Yes| E[Safe user error]
D -->|No| F[Retry or context recovery]
F --> G[Configured model fallback]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +47, Tests +724, Docs +1. Total +772 across 33 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep the shared terminal classification, but add bounded safe guidance to revise the request and try again, then update the delivered-payload assertion without exposing provider explanation text. Do we have a high-confidence way to reproduce the issue? Yes, at source level: an Anthropic SSE refusal becomes a structured diagnostic, and current main’s zero-output error recovery can retry it. The exact-head loopback test documents the one-request, zero-fallback result, but this read-only review did not execute it. Is this the best way to solve the issue? No: centralizing the terminal predicate is the right repair, but its terminal user copy must also state the safe next action rather than leave the user at a dead end. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f74dde80b6c9. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
9395293 to
9dfea93
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Select assistant evidence from the current transcript response or captured completed event, never prior session history. Preserve final structured refusals across retry, compaction, overflow and terminal projection while retaining genuine retry and explicit new-turn behavior. Use one diagnostic predicate and bounded visible refusal copy; remove repeated history fallbacks, obsolete model matching and duplicated test setup. Prove the public SDK and agent exec paths through actual HTTP/SSE and full owner checks. Co-authored-by: Marvinthebored <[email protected]>
|
@clawsweeper re-review Maintainer update at 7403ee6d3e27 addresses the latest proof request and repairs the current-attempt evidence ownership, completed-response bridge, and refusal-versus-overflow collision found during review. The PR body now includes the observed public CLI result: one POST to All 30 reviewed source hashes match the published tree. The owner/sibling batch passed 850 tests, the five-case real SDK HTTP fixture passed, and all 32 final gates plus the full build passed. Both final managed review passes have no actionable findings. Hosted CI for this published head is the remaining landing check. The scripted HTTP proof and controlled Bedrock events do not claim an authenticated provider call. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
cd23d15 to
db31c6f
Compare
|
Independent maintainer validation is in progress on the latest head. The structured-refusal regression fails on current main ( I have a bounded cleanup ready locally: consolidate repeated incomplete-turn visibility classification and remove the now-private replay-error wrapper. This removes 71 production lines, bringing the combined candidate to production +146/-161 (net -15), while preserving the exact-attempt provenance, refusal display, compaction guards, and normal transient retry owner. Independent autoreview is clear at its configured P0 threshold; focused tests and isolated gateway verification are underway. I also corrected the nearby stale documentation for the overload replay loop removed by #134281. The local full build hits the existing TS7056 declaration failure tracked by #135360; I am not duplicating that repair. I am preserving the active maintainer commits and will recheck the live head before publishing any update. |
|
Thanks @Marvinthebored! Proof: A real Gateway child received a structured Anthropic refusal whose hidden explanation looked transient. Exact main made 10 requests across the primary and configured fallback. The merged head made one primary request, no fallback request, and kept the bounded refusal guidance after
|
Follow up on #134980 by computing attempt visibility and silent-reply eligibility once, removing duplicated empty-turn predicates and a one-call terminal-error wrapper. Align the failover docs with the consolidated transient retry owner from #134281. Production delta: -71 lines; no behavior or configuration change.
…35374) Follow up on #134980 by computing attempt visibility and silent-reply eligibility once, removing duplicated empty-turn predicates and a one-call terminal-error wrapper. Align the failover docs with the consolidated transient retry owner from #134281. Production delta: -71 lines; no behavior or configuration change.
…enclaw#135374) Follow up on openclaw#134980 by computing attempt visibility and silent-reply eligibility once, removing duplicated empty-turn predicates and a one-call terminal-error wrapper. Align the failover docs with the consolidated transient retry owner from openclaw#134281. Production delta: -71 lines; no behavior or configuration change.
|
Related follow-up: #145291 (#145291) is now merged. It adds a narrow OpenAI-cyber-to-Daybreak recovery decision in the outer embedded entry path; it does not remove the shared terminal-refusal guard introduced here or make Anthropic refusals transient empty errors. The no-resend and sanitized-refusal handling from #134980 remains in place. This PR is not superseded by #145291. |
Closes #134968
AI-assisted with OpenAI Codex. The original contributor reviewed the initial change. Sanitized session summary.
What Problem This Solves
Anthropic and Amazon Bedrock can return a structured
provider_refusaldiagnostic with no assistant text. OpenClaw used the provider explanation as ordinary error text, so transient-looking wording retried the same request and then advanced to a configured fallback model.Root Cause
The shared retry and overflow owners did not read the structured diagnostic before text classification. Transcript projection could also remove the current assistant slice, which let older session evidence control terminal policy. Gateway history then classified the raw refusal explanation again and could show the wrong recovery text after reload.
Fix
Evidence
4c0588d783c776ed111b8e3e3bf7620a1ab356b4: a structured refusal whose hidden explanation wasService unavailable. Try again.made 10 provider requests acrossclaude-opus-4-8andclaude-sonnet-4-6, then returned no refusal reply.bfec407de2c12f3e0d1697a472bbb423915134c2: the same Gateway flow made oneclaude-opus-4-8request, made no fallback request, ended with error status, and reloadedThe provider refused this request (category: reasoning_extraction). Revise the request and try again.fromchat.history.Sibling Coverage
Codex Contract Check
responses.rs.error.rs.turn.rs.Diff
+132/-76, net+56. Growth adds the shared terminal diagnostic contract, exact-attempt ownership, safe terminal/history projection, and overflow gates; connected stale-session policy is removed.+896/-90.+3/-2.Review Follow-up