Surface auth-shaped provider deaths fast instead of eventually - #122
Merged
Conversation
Two hardenings from a real mid-turn token expiry that presented as a silent session crash: - A Claude turn that dies with an error the auth patterns cannot classify (the SDK's stream diagnostics look nothing like a 401 even when an expired credential caused them) now triggers a rate-limited instance re-probe, so the snapshot flips and the sign-in surface appears in seconds instead of after the next scheduled probe, up to five minutes later. - A Codex error notification marked retryable but reading as an auth failure is now terminal at both layers (adapter event class and session status): retrying cannot heal an expired credential, and the old path burned the app-server's whole reconnect schedule before the sign-in surface appeared.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Two hardenings from this morning's real mid-turn token expiry (the overnight session crash):
[ede_diagnostic] ... stop_reason=nullstream diagnostics) now triggers a rate-limited (15s floor) re-probe of the instance, forked into a driver-scoped fiber. An auth-shaped death flips the snapshot and surfaces the sign-in card in seconds; previously the app could believe the provider was healthy for up to the 5-minute scheduled probe interval, during which the send preflight was blind.willRetry: truewhose message reads as an auth failure is now terminal at both layers — the adapter emitsruntime.errorwithauthentication_errorclass (previously anapi-retrywarning) and the session runtime marks the session errored. Retrying cannot heal an expired credential; the old path played out the app-server's full reconnect schedule (the 20-30s "reconnecting 5/5" noise from the UX audit) before any sign-in surface appeared.No UI changes; server behavior only. Not screenshot-verified — mid-turn token expiry isn't reproducible in the sandbox harness; coverage is the new adapter regression test (retryable 401 → terminal authentication_error) plus the existing suites.
Testing: gates green; CodexAdapter 48/48 (one new), ClaudeAdapter 107/107.