Fixes forwarding of authentication token for claude when using vLLM as backend#49
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughEnhances environment variable mapping for LLM agent configuration by extending Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes authentication token forwarding for Claude Code when backed by a vLLM-compatible server (e.g., Ollama). It extends Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[LLM config enabled\nbase_url / api_key / model] --> B{Iterate llm_env_map}
B --> C{env_var is str?}
C -- yes --> D[targets = list of one string]
C -- no --> E[targets = env_var list]
D --> F
E --> F[For each target:\nmerged_env.setdefault target value]
F --> G{model set and\nllm_model_args present?}
G -- yes --> H[Append --model model\nto command]
G -- no --> I[No CLI flag added]
subgraph Claude fan-out
J[api_key] -->|maps to| K[ANTHROPIC_API_KEY\nANTHROPIC_AUTH_TOKEN]
L[model] -->|maps to| M[ANTHROPIC_MODEL\nANTHROPIC_DEFAULT_OPUS_MODEL\nANTHROPIC_DEFAULT_SONNET_MODEL\nANTHROPIC_DEFAULT_HAIKU_MODEL]
N[base_url] -->|maps to| O[ANTHROPIC_BASE_URL]
end
Last reviewed commit: "Fixes forwarding of ..." |
6cb1a54 to
ef059a9
Compare
ef059a9 to
9653806
Compare
| assert "ANTHROPIC_DEFAULT_OPUS_MODEL" not in env | ||
| assert "ANTHROPIC_DEFAULT_SONNET_MODEL" not in env | ||
| assert "ANTHROPIC_DEFAULT_HAIKU_MODEL" not in env |
There was a problem hiding this comment.
Missing
ANTHROPIC_MODEL assertion in empty-model test
test_llm_empty_model_not_injected now checks that the three ANTHROPIC_DEFAULT_*_MODEL vars are absent when model is empty, but it does not assert that ANTHROPIC_MODEL itself is also absent. Since "model" is now a key in llm_env_map (mapping to all four vars including ANTHROPIC_MODEL), the omission creates a coverage gap — a regression that accidentally injected ANTHROPIC_MODEL with a blank value wouldn't be caught.
| assert "ANTHROPIC_DEFAULT_OPUS_MODEL" not in env | |
| assert "ANTHROPIC_DEFAULT_SONNET_MODEL" not in env | |
| assert "ANTHROPIC_DEFAULT_HAIKU_MODEL" not in env | |
| assert "ANTHROPIC_MODEL" not in env | |
| assert "ANTHROPIC_DEFAULT_OPUS_MODEL" not in env | |
| assert "ANTHROPIC_DEFAULT_SONNET_MODEL" not in env | |
| assert "ANTHROPIC_DEFAULT_HAIKU_MODEL" not in env |
Enhances the handling of environment variables for LLM agent specifications, particularly for the "claude" agent.
Summary by CodeRabbit
New Features
Tests