Repository navigation
fix: bump anthropic claude-cli user-agent from 2.1.75 to 2.1.177 (#94716) - #95048
jincheng-xydt wants to merge 2 commits into
Conversation
The hardcoded claudeCodeVersion was 95 minor versions behind the actual CLI release (2.1.75 vs 2.1.177). Anthropic's API validates the user-agent against a recency window, causing bearer OAuth auth to fail with 'authentication_error: Invalid bearer token'. Fixes openclaw#94716 Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 2:29 PM ET / 18:29 UTC. Summary PR surface: Source 0. Total 0 across 2 files. Reproducibility: yes. for the stale-header path by source inspection: current main and Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Use one shared current Claude Code version source for both Anthropic OAuth builders, add focused header assertions, and require redacted patched runtime or OAuth proof before merge. Do we have a high-confidence way to reproduce the issue? Yes for the stale-header path by source inspection: current main and Is this the best way to solve the issue? No. Updating both constants is a plausible short emergency mitigation, but it is not the best fix because the replacement value is already behind the official package and the code still duplicates a static version source. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 330545f3e925. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0. Total 0 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
…tream The anthropic-transport-stream.ts had a separate copy of the claude-cli version constant that was also 95 versions behind. This was missed in the initial fix. Fixes openclaw#94716 Co-Authored-By: Claude <[email protected]>
|
Updated to also fix the second version constant in anthropic-transport-stream.ts that was missed. @clawsweeper re-review |
|
Closing as the dynamic version resolver approach in PR #94719 is the more sustainable fix. The hardcoded value would go stale again immediately (2.1.183 now). |
Description
Two hardcoded claudeCodeVersion constants were 95 versions behind the actual CLI release (2.1.75 vs 2.1.177). Anthropic's API validates the user-agent against a recency window, causing OAuth bearer auth to fail.
Changes
src/llm/providers/anthropic.ts: Bump claudeCodeVersion from "2.1.75" to "2.1.177"src/agents/anthropic-transport-stream.ts: Bump CLAUDE_CODE_VERSION from "2.1.75" to "2.1.177"Related Issue
Fixes #94716
AI Assistance
This PR was created with assistance from AI (Claude Code).
Real behavior proof
Behavior or issue addressed: Two hardcoded claude-cli user-agent version constants were 95 versions behind the actual CLI release, causing Anthropic API to reject OAuth bearer auth requests.
Real environment tested: Code review confirmed both locations now use "2.1.177".
Exact steps or command run after the patch:
Observed result after fix: Both version constants updated to match the actual installed CLI version.
What was not tested: Full integration test with Anthropic OAuth flow (requires API access).