Skip to content

fix(auth): harden Claude OAuth credential pools - #1196

Open
eddieparc wants to merge 10 commits into
code-yeongyu:mainfrom
eddieparc:eddieparc/fix-claude-sdk-provider-registration
Open

fix(auth): harden Claude OAuth credential pools#1196
eddieparc wants to merge 10 commits into
code-yeongyu:mainfrom
eddieparc:eddieparc/fix-claude-sdk-provider-registration

Conversation

@eddieparc

@eddieparc eddieparc commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve provider-owned OAuth account pools instead of double-appending their flat compatibility credential
  • recognize concrete OAuth credentials selected by shared credential rotation
  • keep synthetic managed sentinels excluded from readiness checks
  • classify OAuth refresh DNS, connection, timeout, socket, and fetch failures as temporary provider errors
  • retain persistent account blocking for invalid_grant, invalid_token, revoked tokens, HTTP 401, and unauthorized responses

Root causes

  1. The shared login layer appended the Claude provider's already-complete account pool a second time, creating a fake slot from its managed sentinel.
  2. The managed auth lane wrapped every token-refresh exception as authentication_failed, so a DNS outage permanently blocked a valid account until re-login.

Verification

  • transient/auth classification regression: 5 cases passed
  • Claude OAuth regression suite: 5 files, 50 tests passed
  • credential pool regression: 5 tests passed
  • TypeScript, Biome, full monorepo build, browser smoke, and repository pre-commit checks passed
  • Anthropic DNS and HTTPS probes passed 3/3 after the outage
  • expired-token refresh succeeded and three consecutive live claude-sdk-oauth requests passed with fallback disabled

@eddieparc eddieparc changed the title fix(auth): preserve selected Claude OAuth slots fix(auth): preserve Claude OAuth credential pools Aug 30, 2026
@eddieparc eddieparc changed the title fix(auth): preserve Claude OAuth credential pools fix(auth): harden Claude OAuth credential pools Aug 30, 2026
@eddieparc

Copy link
Copy Markdown
Contributor Author

Cross-reference: Linear OLI-281 (https://linear.app/oliveline/issue/OLI-281/senpi-claude-sdk-oauth-provider-%EB%9D%BC%EC%9A%B0%ED%8C%85%EC%9C%BC%EB%A1%9C-OMO-%EC%84%B8%EC%85%98-%EC%9E%AC%EA%B0%9C-%EC%8B%A4%ED%8C%A8), GitHub issue #1261 (#1261). Real Orca QA on resumed session 01a05add-8e0c-7918-b2c8-551e0298a50d returned RESUME_OK without a new provider-configuration error using claude-sdk-oauth/claude-opus-5:high.

code-yeongyu added a commit that referenced this pull request Sep 3, 2026
A provider whose own login returns the complete pooled credential was double-pooled: appendLoginSlot read that result's top-level fields as a flat credential and appended them as a second slot. For claude-sdk-oauth those fields are the managed sentinel, so a second account produced a login-2 slot holding placeholder tokens.

Adopts the slots.ts hunk from #1304 and #1196 by @eddieparc.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
code-yeongyu added a commit that referenced this pull request Sep 3, 2026
…d account

Shared credential rotation projects one named slot onto the flat credential shape and strips accounts, so the availability predicate counted zero accounts and reported "Provider is not configured: claude-sdk-oauth". A projected sentinel still counts as zero, leaving the ambient opt-in path unchanged.

Adopts the oauth-login.ts hunk from #1304 and #1196 by @eddieparc.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant