Skip to content

fix(claude): accept newer patch releases as native clients - #5820

Open
camy-x wants to merge 1 commit into
router-for-me:devfrom
camy-x:fix/claude-code-patch-version-detection
Open

camy-x wants to merge 1 commit into
router-for-me:devfrom
camy-x:fix/claude-code-patch-version-detection

Conversation

@camy-x

@camy-x camy-x commented Sep 14, 2026

Copy link
Copy Markdown

Fixes #5715.

Claude Code 2.1.263 currently fails native-client detection because its User-Agent version must exactly match the 2.1.258 baseline. This change accepts patch releases in the configured major/minor line at or above the measured baseline, so newer 2.1.x clients preserve their native request identity.

Older versions and unmeasured major/minor lines still fall back to cloaking. Device-profile learning remains pinned to the exact User-Agent, SDK package, and runtime baseline, and the existing strong-signal plus native-entrypoint checks remain unchanged.

Validation:

  • go test -count=1 -run 'TestDetectClaudeCodeRequest|TestResolveClaudeDeviceProfileLocal|TestApplyClaudeHeaders_DisableDeviceProfileStabilization|TestApplyClaudeHeaders_LegacyModePreservesConfiguredUserAgentOverrideForClaudeClients|TestClaudeExecutor_ConfirmedNewerPatchClaudeCodeRequestPreservesInteractiveIdentity' ./internal/runtime/executor/helps ./internal/runtime/executor
  • go vet ./internal/runtime/executor/helps ./internal/runtime/executor
  • go build -o test-output ./cmd/server
  • go test -count=1 ./... passes outside internal/runtime/executor; that package has a pre-existing TestOpenAICompatExecutorToolResultContentByInputModalities failure reproduced on a clean origin/dev. An unrelated XAI timing assertion also flaked once and passed on an isolated rerun.

Assistance disclosure: implementation and verification were AI-assisted and reviewed against the repository contribution rules.

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