Skip to content

fix: graceful handling of transient API connection errors#47

Open
mkonopelski-gd wants to merge 2 commits into
mainfrom
fix/better-conn-error-handling
Open

fix: graceful handling of transient API connection errors#47
mkonopelski-gd wants to merge 2 commits into
mainfrom
fix/better-conn-error-handling

Conversation

@mkonopelski-gd

@mkonopelski-gd mkonopelski-gd commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Problem

A lost API connection during generation (laptop asleep / no internet) was silently swallowed: connection errors went unclassified, and a single blip could falsely mark a phase completed that never actually ran.

Fix

  • Classify transient connection errors as CONNECTION_ERROR in model_routing (narrow pattern list).
  • No false checkpoint: a connection-lost phase aborts before the checkpoint write, so a later retry_generation re-runs it instead of skipping it.

Connection retries are left to the Claude SDK default (no custom wait-loop, no new config).

Tests: test_classify_error.py::TestConnectionError, test_execute_all_phases_connection_error.py — backend 2011 passed / 36 skipped. No new lint/type errors.

A lost API connection (laptop asleep / no internet) during generation was
silently swallowed: connection errors were unclassified, a single blip could
falsely mark a phase completed, and a total failure still reported "complete".

- classify CONNECTION_ERROR in model_routing via a narrow pattern list
- abort a connection-lost phase before the checkpoint write so a resume
  re-runs it instead of skipping it
- surface all-workspace failures (generation + deploy) so the run fails
  cleanly with a "run retry_generation once you're back online" message;
  partial success still continues (fail only when every workspace fails)

Connection retries remain the Claude SDK default (no custom wait-loop).
Backend: 2016 passed / 36 skipped.
Remove the multi-line comment on the CONNECTION_ERROR abort branch to
match the terser style of the sibling TOOL_CALL_FAILURE case, and drop
_raise_if_all_workspaces_failed (and its test) — surfacing an
all-workspace failure through the orchestrator is out of scope for
this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant