Repository navigation
fix(agents): guide users after HTTP 400 prompt-size rejection - #159712
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 12:38 PM ET / 16:38 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR recognizes bounded HTTP 400 prompt-size errors and gives users guidance to shorten their prompt or choose a model with a larger limit. Merge readiness✅ Ready for maintainer review The change remains useful and has no blocking correctness findings. Current main still lacks this prompt-size guidance, and the earlier runtime proof remains applicable after the rebase. The overlapping open PR does not supersede this branch’s fixed, sanitized wording. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s shared failure renderer turns provider errors into user-facing messages. The terminal reply pipeline consumes that wording and returns an error reply to the originating conversation. flowchart TD
A[Provider request fails] --> B[Classified failure]
B --> C[Shared failure renderer]
C --> D{Bounded HTTP 400 prompt-size error}
D -->|Yes| E[Fixed recovery guidance]
D -->|No| F[Existing failure wording]
E --> G[Terminal conversation reply]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +30, Tests +107. Total +137 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep prompt-size recovery wording in the existing shared renderer, using bounded recognition and static guidance while preserving genuine throttle behavior. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the affected path: a rate-limit-classified HTTP 400 carrying the reported prompt-size prose reaches the shared terminal renderer. The contributor’s before/after loopback trace confirms the behavior; this review did not execute it. Is this the best way to solve the issue? Yes, the patch repairs the existing presentation owner without changing retry policy, configuration, or stored state. Static guidance avoids forwarding provider-controlled billing advice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 817706084620. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
35792be to
732ff84
Compare
732ff84 to
f751850
Compare
f751850 to
25e105a
Compare
25e105a to
ea80060
Compare
ea80060 to
a8ebfb3
Compare
|
@clawsweeper re-review Rebased onto current main. Independent P0–P2 review is clean; fresh Linux regression tests, formatting, and lint pass. Please review the updated head. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* commit 'c39d9b0692dbaafa5b1bfe02514c9f6411ab5546': (30 commits) fix(ci): clear MCP audit and service-worker test blockers (#166217) test(gateway): wait for steering admission in FIFO fixtures fix(llama-cpp): managed setup crashes and loops on macOS below 13.3 (#163358) perf(worktrees): avoid full session parsing during GC (#166072) fix(update): recover stopped legacy managed services (#166232) perf(gateway): stream bounded link preview metadata (#166195) perf(diagnostics): release completed Git operation state (#166214) chore(deps): update fs-safe to 0.24.1 and clone plugin source captures (#166189) feat(clients): adopt worker-local inference placement (#163647) test: serialize PowerShell completion process suites (#166229) test: stabilize release timing boundaries (#166218) refactor(sessions): persist run outcomes only; liveness comes from the run registry (#165733) test(gateway): prove mention refresh after config retargeting fix(team-reports): keep the missed closed day when catch-up runs after midnight (#165780) test(gateway): join WebChat queue admission and drain completion fix(logging): reject blank diagnostic stability query fields (#145532) fix(agents): report unparseable serialized edit arguments (#163577) improve(anthropic): log Claude Code version probe failures (#157697) fix(agents): clarify prompt-size provider failures (#159712) fix(memory): re-throw non-ENOENT/ENOTDIR errors in root memory file lookup (#107921) ...
What Problem This Solves
The terminal failure reply can miss prompt-size guidance for an HTTP 400 and show retry advice or misleading provider text instead.
Related: #159184
Why This Change Was Made
The terminal reply now recognizes bounded structured prompt-size errors and returns fixed guidance. Oversized error bodies stay generic, and HTTP 429 throttling keeps the pinned-main generic rate-limit copy.
User Impact
Users are told to shorten the prompt or choose a model with a larger per-request limit.
Evidence
buildKnownAgentRunFailureReplyPayloadthrough the same real HTTP fixture on pinned main7fbcd48629600a266cfd1a27999ce81fbe552c18and exact HEADea80060883c465093878c40aa993375ab7044480.user-copy.test.ts34/34 (0.61 s Vitest; 1.92 s command wall time) andagent-runner-failure-reply.test.ts25/25 (8.95 s Vitest; 11.20 s command wall time). Updated-head CI seconds are pending its run.proof-live.ts
AI-assisted: built with Codex