Skip to content

Surface auth-shaped provider deaths fast instead of eventually - #122

Merged
badcuban merged 1 commit into
mainfrom
fix/provider-auth-hardening
Aug 7, 2026
Merged

Surface auth-shaped provider deaths fast instead of eventually#122
badcuban merged 1 commit into
mainfrom
fix/provider-auth-hardening

Conversation

@badcuban

@badcuban badcuban commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Two hardenings from this morning's real mid-turn token expiry (the overnight session crash):

  • Claude: a turn dying with an unclassifiable error (like the SDK's [ede_diagnostic] ... stop_reason=null stream 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.
  • Codex: an error notification with willRetry: true whose message reads as an auth failure is now terminal at both layers — the adapter emits runtime.error with authentication_error class (previously an api-retry warning) 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.

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.
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
threadlines Skipped Skipped Aug 7, 2026 2:59pm

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Aug 7, 2026
@badcuban
badcuban merged commit 2281123 into main Aug 7, 2026
15 checks passed
@badcuban
badcuban deleted the fix/provider-auth-hardening branch August 7, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant