fix: graceful handling of transient API connection errors#47
Open
mkonopelski-gd wants to merge 2 commits into
Open
fix: graceful handling of transient API connection errors#47mkonopelski-gd wants to merge 2 commits into
mkonopelski-gd wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
completedthat never actually ran.Fix
CONNECTION_ERRORinmodel_routing(narrow pattern list).retry_generationre-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.