Repository navigation
fix(provider): retry bound accounts after transient 403/auth cooldowns - #2267
Open
singlerider wants to merge 1 commit into
Open
singlerider wants to merge 1 commit into
singlerider wants to merge 1 commit into
Conversation
singlerider
marked this pull request as ready for review
November 21, 2026 03:22
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryBound accounts can retry after temporary auth, 403, and transport failures. Quota cooldowns and known account exhaustion still block requests.
The earlier weekly-limit finding is fixed. Its thread was manually resolved without an explanatory reply.
|
A single transient Anthropic 403 ("Request not allowed") recorded a
5-minute runtime cooldown for the session's bound account. The bound
account pre-flight then bailed on every later turn with "is unavailable"
without contacting the API, so the cooldown was never cleared by a
successful request. Sessions stayed wedged until the daemon restarted.
Only quota cooldowns now short-circuit the bound-account pre-flight.
Auth, 403 and transport cooldowns fall through to a real attempt, which
clears the marker on success or re-records it on failure.
singlerider
force-pushed
the
fix/bound-account-transient-403
branch
from
November 21, 2026 03:47
bd07586 to
7d2a866
Compare
xenking
added a commit
to xenking/jcode
that referenced
this pull request
Nov 22, 2026
Keep quota cooldowns as a preflight guard, but let a bound account prove recovery from transient auth or transport failures. Upstream-PR: 1jehuang#2267 Co-authored-by: Shane Engelman <[email protected]>
xenking
added a commit
to xenking/jcode
that referenced
this pull request
Nov 22, 2026
Upstream-PR: 1jehuang#1357 Upstream-PR-Commit: 1jehuang#1357 0da5e81 Upstream-PR: 1jehuang#1362 Upstream-PR-Commit: 1jehuang#1362 5962058 Upstream-PR: 1jehuang#1486 Upstream-PR-Commit: 1jehuang#1486 fadc624 Upstream-PR: 1jehuang#1733 Upstream-PR-Commit: 1jehuang#1733 01f3415 Upstream-PR: 1jehuang#1750 Upstream-PR-Commit: 1jehuang#1750 1ac0c82 Upstream-PR: 1jehuang#1822 Upstream-PR-Commit: 1jehuang#1822 73f85fc Upstream-PR: 1jehuang#1912 Upstream-PR-Commit: 1jehuang#1912 36d7682 Upstream-PR: 1jehuang#1978 Upstream-PR-Commit: 1jehuang#1978 0f55643 Upstream-PR: 1jehuang#2007 Upstream-PR-Commit: 1jehuang#2007 638f87c Upstream-PR: 1jehuang#2213 Upstream-PR-Commit: 1jehuang#2213 c5e1487 Upstream-PR: 1jehuang#2234 Upstream-PR-Commit: 1jehuang#2234 0d4d5d4 Upstream-PR: 1jehuang#2266 Upstream-PR-Commit: 1jehuang#2266 217ddc2 Upstream-PR: 1jehuang#2267 Upstream-PR-Commit: 1jehuang#2267 e98c40b
Vedaru
pushed a commit
to Vedaru/jcode
that referenced
this pull request
Nov 24, 2026
A cached provider cooldown skipped every turn for its full TTL after any failover-classified failure, including a 402 billing refusal. Only a successful request clears the marker, and the marker blocks the very request that would clear it, so a top-up (or a fixed key) looks ignored for five minutes behind a stale "runtime-error, Nm ago" note. Apply the rule from 1jehuang#2267 to the generic failover preflight as well: only quota/plan exhaustion justifies skipping a request. Billing, auth and transport failures reach the provider again and clear on success.
Vedaru
pushed a commit
to Vedaru/jcode
that referenced
this pull request
Nov 24, 2026
A cached provider cooldown skipped every turn for its full TTL after any failover-classified failure, including a 402 billing refusal. Only a successful request clears the marker, and the marker blocks the very request that would clear it, so a top-up (or a fixed key) looks ignored for five minutes behind a stale "runtime-error, Nm ago" note. Apply the rule from 1jehuang#2267 to the generic failover preflight as well: only quota/plan exhaustion justifies skipping a request. Billing, auth and transport failures reach the provider again and clear on success.
This branch has not been deployed
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.
Closes #2268
Problem
A single transient Anthropic
403 Forbidden(Request not allowed, e.g. from briefly routing through a blocked region over VPN) records a 5-minute runtime cooldown for the session's bound account. The bound-account pre-flight inMultiProviderthen bails with<provider> (<label>) is unavailable: ... (runtime-error, Nm ago)on every later turn without contacting the API. Only a successful request clears the marker, so affected sessions stay wedged until the daemon restarts.Repro
See #2268: VPN into a blocked region, get a 403, switch back. jcode never retries.
Expected vs actual
Fix
Only quota cooldowns short-circuit the bound-account pre-flight (reusing existing
is_quota_failure). Auth, 403 and transport cooldowns fall through to a real attempt, which clears the marker on success or re-records it on failure.Tradeoffs / edge cases
account_known_exhaustedstill skip the request as before.Tests
bound_preflight_only_skips_requests_for_quota_cooldownscargo test -p jcode-base --lib provider::: 312 passed