fix(sdk): Short-circuit repeated provider failures#291
Merged
Conversation
Stop Warden runs after repeated provider-unavailable failures, and stop immediately on authentication failures. This prevents outage-shaped failures from burning through every chunk while preserving regular retry behavior for transient attempts. Record provider_unavailable as a stable error code in reports and group matching action errors in Sentry. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Return SDK reports when a provider circuit opens after earlier hunks already produced findings. This keeps direct runSkill consumers aligned with the CLI task path while still treating empty circuit-open runs as fatal. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Record provider failures after a hunk exhausts retries instead of counting each retry attempt. This keeps the circuit breaker threshold tied to consecutive failing hunks rather than transient attempts within one hunk. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Return a circuit reason only when the current failure is a circuit-breaker code. This keeps in-flight max_turns and sdk_error hunks from being mislabeled after another hunk opens the shared circuit. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Classify all-hunks-failed runs by the shared analysis failure code even when extraction failures are also present. This keeps auth and provider outages from falling back to generic all_hunks_failed reports. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Require a skill to have its own hunk or extraction failures before shared circuit state can synthesize a failed report. This keeps concurrent clean runs from inheriting another skill's circuit-breaker failure. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2906cd5. Configure here.
Require SDK runs to have their own hunk or extraction failures before shared circuit state can throw. This keeps clean zero-finding SDK runs from inheriting another task's circuit-breaker failure. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
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.

Previously, outage-shaped Claude failures could exhaust retries independently for every chunk. Warden now shares a lightweight circuit breaker across the run so obvious auth failures and repeated provider failures stop queued analysis early.
Circuit Breaker
Authentication failures open the circuit immediately. Provider-unavailable failures open after consecutive failures across chunks and share the same abort path used by the CLI, Ink renderer, and GitHub Action.
Reporting
provider_unavailable is a stable report ErrorCode, and action Sentry captures provider/all-chunk failures with stable fingerprints.
Validated with
pnpm run build,pnpm lint, andpnpm test.