Skip to content

fix(anthropic): Claude Code OAuth identity floor — Fable 5.x no longer rejected (port prime-agent#1993) - #106414

Open
teknium1 wants to merge 1 commit into
mainfrom
prime-agent-port/claude-code-version-floor
Open

fix(anthropic): Claude Code OAuth identity floor — Fable 5.x no longer rejected (port prime-agent#1993)#106414
teknium1 wants to merge 1 commit into
mainfrom
prime-agent-port/claude-code-version-floor

Conversation

@teknium1

@teknium1 teknium1 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Anthropic OAuth (Claude subscription) requests no longer get rejected on Claude Fable 5.x models because Hermes presented a stale Claude Code identity.

Symptom

Anthropic now gates the newest model families (Fable 5.x) on a Claude Code client identity >= 2.1.251 and rejects OAuth requests carrying older versions ("Claude Code X does not support this model"). Hermes' fallback identity was 2.1.74, and a machine with a stale installed claude CLI would detect and send an equally old version — breaking OAuth exactly for subscription users on the newest models.

Upstream evidence: PrimeIntellect-ai/prime-agent hit the identical rejection and bumped their impersonated version in prime-agent#1993 (their pinned 2.1.75 was rejected for Fable 5.x; fixed at >= 2.1.251), then again in prime-agent#2069.

Change

  • _CLAUDE_CODE_VERSION_FALLBACK: 2.1.742.1.266 (current @anthropic-ai/claude-code npm latest at time of PR).
  • New _CLAUDE_CODE_VERSION_FLOOR = (2, 1, 251): a detected CLI version below the floor clamps to the fallback instead of undercutting it. Prime pins a constant; Hermes detects the installed CLI, so the port needs the floor to fix the whole class — otherwise machines with an old CLI stay broken after the fallback bump.
  • Non-numeric detected versions fall through to the plain "starts with a digit" acceptance as before.

Validation

Check Result
scripts/run_tests.sh tests/agent/test_anthropic_adapter.py 98 passed, 0 failed
Live E2E (this machine, no claude CLI installed) resolved identity 2.1.266, floor satisfied
Invariant test fallback always >= floor; stale detection (2.1.74) clamps; recent detection (2.1.260) wins
ruff, windows-footguns, compat pointers clean (also fixed 6 pre-existing bare read_text/write_text in the touched test file per checker policy)

Live repro: before — _get_claude_code_version() on this machine returned 2.1.74 (the stale fallback), the exact identity class Anthropic rejects for Fable 5.x per the upstream A/B; after — returns 2.1.266, above the 2.1.251 gate. (A full wire A/B against a Fable 5.x OAuth request was not run: no Anthropic OAuth credential is configured on this host; the gate threshold is taken from prime-agent's live A/B in #1993.)

Root cause in one sentence: the impersonated Claude Code version was pinned in Feb-2026 territory while Anthropic moved the minimum accepted identity forward.

Ported by the weekly prime-agent PR scout (cron). Credit: Sebastian Müller (@badlogic lineage repo, PrimeIntellect-ai/prime-agent#1993).

Infographic

infographic

…1.251 floor

Port from PrimeIntellect-ai/prime-agent#1993: Anthropic now gates Claude
Fable 5.x models on a Claude Code identity >= 2.1.251 and rejects OAuth
requests from older versions with "Claude Code X does not support this
model". Our fallback was 2.1.74, and a stale installed CLI could report
an equally old version, so OAuth subscription users hit the rejection on
the newest models.

- fallback bumped to 2.1.266 (current @anthropic-ai/claude-code latest)
- detected CLI versions below the (2, 1, 251) floor clamp to the
  fallback instead of undercutting it
- invariant test: fallback always >= floor, stale detection clamps,
  recent detection wins
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 2b60e98 — fix(anthropic): raise Claude Code OAuth identity to 2.1.266

⚠️ Warnings

CI timings · View report · View job

Wall time 6m46s vs 4m55s (+37.6%). 3 job(s) slower, 10 faster, 1 unchanged.

  • OS-specific tests / macOS-only tests: -60.0s
  • OSV scan / Emit review status: -33.0s
  • OS-specific tests / Windows-only tests: +18.0s
  • Check no committed infographics / check-no-committed-infographics: -16.0s
  • Profile artifact check / Reject profile archives: -8.0s

OSV vulnerability scan · View job

71 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/anthropic Anthropic native Messages API area/auth Authentication, OAuth, credential pools labels Sep 9, 2026

@ehz0ah ehz0ah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 2b60e988b2ba13abf4ca49fa3c5b31e6a0c216b7.

The OAuth-only identity path now preserves the documented Claude Code 2.1.251 floor for released numeric versions while leaving API-key and third-party client headers unchanged. Prime Agent #1993 provides the rejection threshold, and npm currently reports 2.1.266 as the latest Claude Code release, matching the fallback.

Validation:

  • scripts/run_tests.sh tests/agent/test_anthropic_adapter.py: 98 passed
  • focused floor and version-shape probes: numeric boundaries passed
  • Ruff and git diff --check: passed

I found no blocking correctness or regression issue.

@kshitijk4poor

Copy link
Copy Markdown
Contributor

Review notes at 2b60e98 (no blockers):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P1 High — major feature broken, no workaround provider/anthropic Anthropic native Messages API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants