feat(sse): add dynamic claude code client version and identity resolver - #12555
Closed
TheDemonTuan wants to merge 4 commits into
Closed
feat(sse): add dynamic claude code client version and identity resolver#12555TheDemonTuan wants to merge 4 commits into
TheDemonTuan wants to merge 4 commits into
Conversation
…r for client bundle compatibility
…ait startup identity
…nifest, and compute billing version dynamically per request
|
Stop
…On Thu, Sep 3, 2026, 12:30 AM Nguyễn Viết Tuấn ***@***.***> wrote:
Summary
Resolves hardcoded Claude Code client version and fingerprint drift by
introducing a dynamic identity resolver.
Problem
Previously, CLAUDE_CODE_CLIENT_VERSION and associated metadata were
static constants. When upstream Anthropic/Claude Code releases new client
versions or requires updated wire identities for newly released models,
static constants lead to outdated headers, fingerprint divergence, or
upstream rejections.
Solution
1. *Dynamic Identity Resolver
(src/shared/services/claudeCodeIdentity.ts)*:
- Resolves consistent ClaudeCodeIdentity tuple (version,
buildRevision, sdkVersion, runtimeVersion, billingVersion,
userAgentCli, userAgentSdkCli).
- Priority pipeline:
- Explicit environment override (CLAUDE_CODE_CLIENT_VERSION or
CLAUDE_CODE_VERSION_MODE=fixed)
- Locally installed binary (claude --version via execFile
without shell interpolation)
- NPM registry lookup ***@***.***/claude-code dist-tags with
configurable channel stable or latest)
- Bundled known-good baseline fallback (2.1.236)
- In-memory SWR caching so hot-path calls (getClaudeCodeIdentity())
have zero latency.
2. *Unified Facade (src/shared/constants/claudeCodeClient.ts)*:
- Dynamic accessors while maintaining backward-compatible constant
exports.
3. *Synchronized Downstream Consumers*:
- Updated open-sse/config/anthropicHeaders.ts,
open-sse/config/providers/shared.ts, open-sse/executors/base.ts,
open-sse/services/claudeCodeCompatible.ts, and
open-sse/services/ccBridgeTransforms.ts.
- Async bootstrap initialization in src/instrumentation-node.ts.
4. *Environment Variables*:
- Added CLAUDE_CODE_VERSION_MODE, CLAUDE_CODE_VERSION_CHANNEL,
CLAUDE_CODE_CLIENT_VERSION, CLAUDE_CODE_VERSION_CACHE_TTL to
.env.example.
Testing
- Added unit test suite tests/unit/claude-code-dynamic-identity.test.ts
.
- Verified lockstep synchronization in
tests/unit/claude-codex-identity-version-sync.test.ts.
- Passed all unit tests, TypeScript typecheck (npm run typecheck:core),
and cycles check (npm run check:cycles).
------------------------------
You can view, comment on, or merge this pull request online at:
#12555
Commit Summary
- 5a2efb1
<5a2efb1>
feat(sse): add dynamic claude code client version and identity resolver
File Changes
(16 files <https://github.com/diegosouzapw/OmniRoute/pull/12555/files>)
- *M* .env.example
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-a3046da0d15a27e89f2afe639b25748a7ad4d9290af3e7b1b6c1a5533c8f0a8c>
(9)
- *M* config/quality/eslint-suppressions.json
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-44674d6a8d3f6c10f6d869733d7c546e3d310de56c5758b4130d8796a4024663>
(59)
- *M* open-sse/config/anthropicHeaders.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-13dd25bd0d7aeda3132e2a91e27f7793726e6331713a1b55171b60e5ade2092e>
(24)
- *M* open-sse/config/claudeCodeCompatibleIdentity.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-aaa52a05157cc8faac754021906186813f701d564469196f7cd0026771b1e5f4>
(20)
- *M* open-sse/config/providers/shared.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-94c6bc38c29174ddf7aa685dae2467b333fca3b1fc3940abcdde4a64cf96abab>
(9)
- *M* open-sse/executors/base.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-ca62138c63bb28dbe9273d132649b55fb465149f292e9ca288f664514f790093>
(36)
- *M* open-sse/services/ccBridgeTransforms.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-d6b6dac1b6869d0e4ee181e4c39273fd64bcc0c20f046e9949d61cd6a30b1036>
(3)
- *M* open-sse/services/claudeCodeCompatible.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-110a2b153a197e563d069867dac9d63906793fce41e3369cab6d11434035ae86>
(12)
- *M* src/instrumentation-node.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-2899b0654861bac4a618cf6c4a0d38d3455b1345d0660b159711305703e645f7>
(20)
- *M* src/shared/constants/claudeCodeClient.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-76e6511dadf745418d6d64bb2d7459dd33125c6ac883861ce1465093265aaf26>
(62)
- *A* src/shared/services/claudeCodeIdentity.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-e5d844e8d7a2cb4b6d50daf4b22197f064923875100275125f21ba3e27cb256f>
(217)
- *M* tests/unit/anthropic-cache-fingerprint.test.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-767f79a552b2b9391f5f9e0a9eef8b0bfc25a0f3c1d6a30896b5b55b214b5d91>
(2)
- *M* tests/unit/cc-bridge-transforms.test.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-10ce5f25712c6888a570edf3895fdbcfef4921c94a36c03b6f70594dc385824e>
(2)
- *A* tests/unit/claude-code-dynamic-identity.test.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-6ec6c94a82dd9aa976ef30f177ecd6c0f80b5d777a25bae0d9d7cdb1f2d019f6>
(79)
- *M* tests/unit/claude-codex-identity-version-sync.test.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-4797d091532817f370edfbd3b3140d9a3095b8d231dcf13e6d5de9fc4acb9510>
(7)
- *M* tests/unit/client-identity-profiles.test.ts
<https://github.com/diegosouzapw/OmniRoute/pull/12555/files#diff-7902eeed85b197714d578d45e8d66eb0e9eeb4eb60b67df84857c46e9eb51263>
(6)
Patch Links:
- https://github.com/diegosouzapw/OmniRoute/pull/12555.patch
- https://github.com/diegosouzapw/OmniRoute/pull/12555.diff
—
Reply to this email directly, view it on GitHub
<#12555?email_source=notifications&email_token=BGIJUI6XCWJBFLJJS5KRGG35NDXXNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DIMRZGE3TGNJXGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGIJUIZXEY6TB7GWCLBHULD5NDXXNAVCNFSNUABGKJSXA33TNF2G64TZHMYTCNJXGEYDEMRYGI5US43TOVSTWNJTGMZDENBWGY3TPILWAI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Contributor
Author
|
Closing this unmerged change at the operator's request. Dynamic Claude Code wire-identity resolution can diverge from the known-good client fingerprint and block model calls. The static identity logic on release/v3.8.51 remains the supported behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves hardcoded Claude Code client version and fingerprint drift by introducing a dynamic identity resolver.
Problem
Previously,
CLAUDE_CODE_CLIENT_VERSIONand associated metadata were static constants. When upstream Anthropic/Claude Code releases new client versions or requires updated wire identities for newly released models, static constants lead to outdated headers, fingerprint divergence, or upstream rejections.Solution
src/shared/services/claudeCodeIdentity.ts):ClaudeCodeIdentitytuple (version,buildRevision,sdkVersion,runtimeVersion,billingVersion,userAgentCli,userAgentSdkCli).CLAUDE_CODE_CLIENT_VERSIONorCLAUDE_CODE_VERSION_MODE=fixed)claude --versionviaexecFilewithout shell interpolation)@anthropic-ai/claude-codedist-tags with configurable channelstableorlatest)2.1.236)getClaudeCodeIdentity()) have zero latency.src/shared/constants/claudeCodeClient.ts):open-sse/config/anthropicHeaders.ts,open-sse/config/providers/shared.ts,open-sse/executors/base.ts,open-sse/services/claudeCodeCompatible.ts, andopen-sse/services/ccBridgeTransforms.ts.src/instrumentation-node.ts.CLAUDE_CODE_VERSION_MODE,CLAUDE_CODE_VERSION_CHANNEL,CLAUDE_CODE_CLIENT_VERSION,CLAUDE_CODE_VERSION_CACHE_TTLto.env.example.Testing
tests/unit/claude-code-dynamic-identity.test.ts.tests/unit/claude-codex-identity-version-sync.test.ts.npm run typecheck:core), and cycles check (npm run check:cycles).