mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-07 00:24:50 +08:00
Dogfood showed oversized requests still surfacing as raw hard errors, even when claw could tell the user exactly how to recover. This keeps context-window failures classified, recognizes the same failure when it comes back from a provider response, and renders recovery steps that point operators at the existing compaction and fresh-session paths instead of a provider-style dump. Constraint: Keep the failure class explicit so automation and operators can still distinguish context-window exhaustion from generic provider failures Constraint: Reuse existing /compact and session-reset UX instead of inventing a new recovery workflow Rejected: Auto-run compaction on failure | mutates session state on an error path the user may want to inspect first Rejected: Only prettify local preflight failures | provider-returned context-window errors would still leak raw failure text Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep provider-side context-window detection aligned with real oversized-request messages before broadening the marker list Tested: cargo fmt --all --check Tested: cargo test -p api Tested: cargo test -p rusty-claude-cli Tested: cargo clippy -p api -p rusty-claude-cli --all-targets -- -D warnings Not-tested: cargo test --workspace