Skip to content

fix(anthropic): refresh generated Claude OAuth client profile - #8464

Closed
oocheol wants to merge 1 commit into
lidge-jun:devfrom
oocheol:codex/fix-claude-oauth-version-20261110
Closed

oocheol wants to merge 1 commit into
lidge-jun:devfrom
oocheol:codex/fix-claude-oauth-version-20261110

Conversation

@oocheol

@oocheol oocheol commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Codex requests routed through the Anthropic OAuth adapter can select claude-fable-5-2, but the provider rejects the generated claude-cli/2.1.280 identity with HTTP 400 claude_code_version_too_old (minimum 2.1.290). Updating a separately installed Claude CLI does not change OpenCodex's generated profile.

  • Refresh the shared profile to Claude Code 2.1.321, SDK 0.128.0, and runtime v26.12.1, using the official Windows x64 distribution as the profile source. Translated Messages, native fallback, search, vision, and account reads consume the existing shared constants.
  • Preserve observed native client identities, explicit operator-header precedence, credentials, account/session isolation, betas, and model admission. The ordinary API-key User-Agent also receives the shared SDK version update; API-key requests do not acquire the CLI identity.
  • Add buffered/streamed regression cases that check the upstream-reported minimum independently of the exported constant, through both translated and native fallback builders. Update the English/Korean provider guides and the architecture contract.

Closes #8461.

Based on latest dev 8cab704, refreshed again before commit. This is one focused commit across six files.

Profile evidence and review boundary

Inspected the official npm artifacts with npm pack --ignore-scripts on 2026-11-10:

  • @anthropic-ai/[email protected] declares the matching platform package.
  • @anthropic-ai/[email protected], npm SHA-1 73aca8b206302a4c9edc66729a98aea87da98d93: the bundled JavaScript supplies SDK 0.128.0 to X-Stainless-Package-Version and process.version to the Node runtime header; the bundled runtime strings identify Node compatibility v26.12.1. The CLI User-Agent retains the claude-cli/<version> (external, cli) form.

This is static package inspection plus the bounded live checks below, not a claim that every CLI feature or platform was exercised. No downloaded package or credential material is included in the diff. The installed proxy and CLI were not modified or restarted.

This changes an authentication-related header profile. Maintainer sponsorship and explicit security review are still required before merge. Keep Draft pending review and current-head CI; the profile does not establish subscription entitlement or bypass a model-access refusal.

Verification

Windows x64; commands below used the repository's node_modules/bun/bin/bun.exe 1.4.4.

  • Red/green: before the source change, bun test --no-env-file --isolate ./tests/clients/client-fingerprint.test.ts --test-name-pattern 'minimum CLI version' --timeout 30000 failed both new cases at the version-floor assertion, as expected. After the fix, the complete file passed with 18 tests / 71 assertions / 0 failures using bun test --no-env-file --isolate ./tests/clients/client-fingerprint.test.ts --timeout 30000.
  • Focused import-connected coverage: 328 passed / 0 failed / 1,629 assertions, ten files, 175.19 seconds, with this exact command:
bun run test:changed --parallel=2 \
  ./tests/adapters/anthropic/anthropic-client-identity.test.ts \
  ./tests/adapters/anthropic/anthropic-account-metadata.test.ts \
  ./tests/adapters/anthropic/anthropic-beta-allowlist.test.ts \
  ./tests/adapters/anthropic/anthropic-messages-passthrough-oauth.test.ts \
  ./tests/claude-integration/messages-native-oauth.test.ts \
  ./tests/vision/vision-anthropic.test.ts \
  ./tests/web-search/web-search-anthropic.test.ts \
  ./tests/oauth/oauth-anthropic-identity.test.ts \
  ./tests/adapters/anthropic/anthropic-reset-grants.test.ts \
  ./tests/providers/provider-anthropic-usage-windows.test.ts --timeout 30000
  • bun run typecheck: passed, 2,376 files.
  • bun run structure:check, bun run privacy:scan, bun run scripts/file-size-ratchet.ts, and git diff --check: passed.
  • From docs-site/, bun install --frozen-lockfile then bun run build: passed, 665 pages / 95,875 internal links. Build emits chunk-size and empty i18n collection warnings; no build or link-check failure.
  • Read-only live checks with the new User-Agent: GET /api/oauth/usage and GET /api/oauth/profile both returned 200, using the existing active credential without refresh or store writes. Response contents and account identifiers were not logged.
  • A separate scratch probe used this branch's createAnthropicAdapter to send a synthetic claude-fable-5-2 Messages request with max_tokens: 64, no tools, and no conversation history. Observed 200, a Messages response containing OK, stop_reason: end_turn, 46 input / 4 output tokens. An earlier probe result was discarded because the scratch harness decoded the bounded-body helper incorrectly; the corrected harness reads its .text result. This verifies one direct upstream request, not the installed proxy, Desktop UI, or all models/accounts.

Scope exception: the full repository suite and unrestricted changed graph were not run for this small profile refresh on the shared Windows workstation; the focused native/account tests alone took almost three minutes. Broader suite and other-platform coverage remain for CI. No hosted CI result is claimed here; fork workflows may require maintainer authorization on the new head.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.
  • I pushed my PR to the latest dev commit.
  • I resolved all correct Codex and CodeRabbit findings.
  • My PR is ready for review.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

@lidge-jun

Copy link
Copy Markdown
Owner

Thank you, @oocheol, for identifying the Claude OAuth client-version issue and contributing the fix and explanation.

The generated client profile and overlapping fingerprint tests have landed in #8474 (merge commit 00c02163e4352be5beb5633a3b6cc3b0be94ec8a). The nonduplicate English and Korean guidance is carried with your attribution in #8482, which remains a draft pending review and CI.

Closing this PR as superseded; the documentation carry remains tracked in #8482.

@lidge-jun lidge-jun closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Provider]: Anthropic OAuth rejects claude-fable-5-2 with claude_code_version_too_old (CLAUDE_CLI_VERSION is 2.1.280, 2.1.290 required)

2 participants