mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 18:01:51 +08:00
Trace the local Claude Code TS request path and align the Rust client with its non-OAuth direct-request behavior. The Rust client now resolves the message base URL from ANTHROPIC_BASE_URL, uses ANTHROPIC_API_KEY for x-api-key, and sends ANTHROPIC_AUTH_TOKEN as a Bearer Authorization header when present. Constraint: Must match the local Claude Code source request/auth split, not inferred behavior Rejected: Treat ANTHROPIC_AUTH_TOKEN as the x-api-key source | diverges from local TS client path Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep direct /v1/messages auth handling aligned with src/services/api/client.ts and src/utils/auth.ts when changing env precedence Tested: cargo test -p api; cargo run -p rusty-claude-cli -- prompt "say hello" Not-tested: Non-default proxy transport features beyond ANTHROPIC_BASE_URL override