Commit 6380626
committed
fix(capacity-retry): expand markers to match real upstream transient errors
Production dialog_logs 10-min sample (886 requests / 149 response.failed events = 17% transient failure rate) reveals the existing marker list missed 100% of real failures:
- "Our servers are currently overloaded. Please try again later." (90%)
- "An error occurred while processing your request. You can retry..." (10%)
The codex CLI cosmetic message "Selected model is at capacity. Please try a different model." that users see is a CLIENT-SIDE fallback rendering, not the real upstream payload. So the previous marker list ("at capacity" / "try a different mode|model") matched the CLI display but never the wire content. Net effect: zero transparent retries in 24h despite ~17% upstream failure rate; every failure leaked to clients.
Fix: add markers covering both observed phrases plus the generic "try again later" tail. Negative test cases pinned for auth / context-length errors which must NOT retry.
Function kept named isCapacityError for minimal blast radius - all three call sites in handler.go (/v1/responses, /v1/chat/completions, /v1/compact) and handler_anthropic.go (/v1/messages) get the broader coverage automatically.1 parent e71f949 commit 6380626
2 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | | - | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| 31 | + | |
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
25 | 41 | | |
26 | 42 | | |
27 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
| |||
0 commit comments