Repository navigation
Commit 93975ab
committed
fix(errors): let a structured server class outrank message inference
Closes the reviewer blocker on #2729. Deriving response.failed status from the
classified payload is only correct if httpStatusFromTerminalError respects the
classification, and it did not: only server_error + server_is_overloaded was
recognized, so a generic upstream_server_error fell through to message
inference. An upstream 5xx whose text contained 'malformed' or 'invalid request'
returned 400, and Claude Code stopped retrying a genuinely retryable failure —
the same inversion #2729 set out to fix, one layer down.
classifyError assigns upstream_server_error to every 5xx it observes, so the
class is authoritative over the words in the message.
Probed before and after against origin/dev: 429/401/403/quota/invalid-request/
client-cancel/proxy_error/undefined all unchanged, and cyber-policy refusals
still return 400 because that check runs earlier. Only the generic server class
moves, 400 -> 502.
Regression is behavioral and mutation-verified: revert the fix and keep the test
-> 45 pass / 1 fail; with the fix -> 46 pass / 0 fail.1 parent 19c328e commit 93975ab
2 files changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
407 | 415 | | |
408 | 416 | | |
409 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
610 | 642 | | |
611 | 643 | | |
612 | 644 | | |
| |||
0 commit comments