This repository was archived by the owner on Apr 2, 2026. It is now read-only.
Commit 57756c9
fix: fail fast on API connection errors instead of retrying for 10 minutes
When the Supermodel API is unreachable, pollJob was retrying connection
errors (connection refused, DNS failure, network down) every 10 seconds
for the full context duration — up to 10 minutes — before giving up.
This blocked the Claude Code Stop hook for the entire outage window.
Connection errors are fundamentally different from job-processing delays:
- "pending"/"processing" status → API is working, polling makes sense
- Connection error → API is unreachable, retrying won't help
Change pollJob to return immediately on connection-level errors so the
Stop hook can call silentExit() and unblock the session without waiting
for the context deadline. 5xx errors, rate limits, and job-in-progress
responses continue to be retried as before.
Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 7c48d8f commit 57756c9
2 files changed
Lines changed: 12 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 229 | + | |
233 | 230 | | |
234 | 231 | | |
235 | | - | |
| 232 | + | |
236 | 233 | | |
237 | 234 | | |
238 | 235 | | |
| |||
472 | 469 | | |
473 | 470 | | |
474 | 471 | | |
475 | | - | |
476 | | - | |
477 | 472 | | |
478 | | - | |
| 473 | + | |
479 | 474 | | |
480 | 475 | | |
481 | 476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
381 | 383 | | |
382 | 384 | | |
383 | 385 | | |
| |||
0 commit comments