Repository navigation
Commit 16cb875
committed
fix(cursor): check failed_precondition before the overload keywords
Final-round auditor found the #2729 failed_precondition arm did not fire on the
shape it exists to catch. It sat AFTER the overload keywords in both
classifyCursorError and inferHttpStatusFromAdapterMessage, and a plan-gated
rejection normally reads 'failed_precondition: model unavailable for this plan'
— which matched 'unavailable' first:
classifyCursorError -> 'Cursor server overloaded'
inferHttpStatus... -> 503
So clients kept retrying a deterministic rejection that can never succeed, which
is the exact misclassification the arm was added to stop. The original test only
covered 'Cursor Connect error failed_precondition: Error', which has no competing
keyword, so 25/25 passed over the defect.
Moved the check ahead of the overload keywords in both functions. The explicit
gRPC status is a structured backend signal; 'unavailable' and 'temporarily' next
to it are inference over free text.
Differential vs origin/dev: exactly one case changes (fp + unavailable, 503 ->
400). Real overloads, auth, rate limit, timeout and invalid-request are all
unchanged, and authentication still outranks both.
211 pass / 0 fail across the ten affected suites; tsc exit 0.1 parent 2483f40 commit 16cb875
3 files changed
Lines changed: 44 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | 244 | | |
252 | 245 | | |
253 | 246 | | |
254 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
259 | 266 | | |
260 | 267 | | |
261 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
338 | 344 | | |
339 | 345 | | |
340 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
72 | 96 | | |
73 | 97 | | |
74 | 98 | | |
| |||
0 commit comments