Repository navigation
fix: a valid token no longer waits behind a proactive refresh - #414
Merged
Merged
Conversation
Admit proven unexpired tokens while proactive or different-token recovery is running. Record the initial job cause and additional 401 rejections; bound rejected-token callers to one two-second wait without cancelling shared rotation or altering its leases and retries. Strengthen the prior per-caller adoption test: when another joiner reports a 401 for the would-be adopted token, neither caller may serve it. The old first-caller success expectation intentionally becomes rejected-access-unchanged; the existing rejecting-caller refusal and zero-exchange claims remain. Add red-first OC1/OC2/Pi join coverage and two CAUGHT catalogue controls. Affected selection: 438 pass, one unchanged vault Prime network-error test exceeded its five-second deadline; not retried. Typecheck, builds, lint/format, restored named controls and Pi host smoke pass.
Always check serving admission before deciding whether a rejected token joins recovery, including after job completion. Preserve the existing validation-retry exception for explicitly caller-rejected material; refresh backoff, permanent errors and external account policy still win. Add red-first coordinator coverage for held proactive/401 recovery and policy exclusions without altering exchange locks, retries or deadlines. The reported CI assertion failed only in its no-backoff positive control: the original fallback bearer was still valid and could be served while proactive rotation ran. Per the parent's explicit decision, that control now requires dispatch from the selected fallback using either of its two known bearers, rather than requiring rotation to win a race. The excluded-backoff half is unchanged. Ran full Core, OpenCode index and Pi suites once: Core 2033 pass/1 fail (initially exposed rejected-token validation-retry behavior, fixed in production and the 151-test impacted selection passed); OpenCode index 304 pass/1 unrelated profile hook timeout, original CI case passed; Pi 317 pass. No full-suite retries or deadline increases. Final types, 9 host join cases, lint/format, catalogue tests, updated cause mutation and restored named baselines pass.
A rebase conflict resolution placed it under the published 2.1.2 heading.
ualtinok
force-pushed
the
fix/refresh-join-cause
branch
from
October 20, 2026 21:33
bd9eaca to
d466263
Compare
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.
A request whose own token was valid could wait behind another row's refresh for the same account, because any in-flight refresh for that account and credential epoch made admission join it, with no overall bound.
Joining is now keyed on why the refresh is running, recorded when the job starts:
Refresh locks, single-use refresh-token protection, attempt caps, backoff and persistence are unchanged.
Red-first regressions on OpenCode 1, OpenCode 2 and Pi (proactive refresh doesn't delay a valid token, a 401 refresh never re-serves the rejected token, the deadline refuses retryably). Mutation rows
refresh-join-checks-causeandrefresh-join-has-overall-deadlineCAUGHT.Summary by cubic
Fixes a bug where a request carrying a valid token could wait behind a proactive refresh for the same account, because any in-flight refresh made it join with no overall bound.
Joining is now keyed on why the refresh is running:
A token rejected by any caller in the shared job is never served again. Refresh locks, single-use refresh-token protection, attempt caps, backoff, and persistence are unchanged. Serving exclusions such as refresh backoff, permanent errors, and account policy are still checked before joining.
Written for commit d466263. Summary will update on new commits.