Repository navigation
fix: accept deepseek in HTTP sessions - #134
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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 Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA module-level ProviderName Literal is added and used by Config.provider and CreateSessionRequest.provider. HTTP server loads agent.toml runtime defaults for session creation. deepseek is wired to disable Anthropic "thinking"; AnthropicProvider forwards thinking to stream and groups adjacent tool_result blocks. Tests, docs, and CLI wording updated. ChangesProvider type and runtime / Anthropic behavior
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
coding-agent/src/coding_agent/core/config.py (1)
106-109: 💤 Low valueConsider using consistent api_key check pattern.
The deepseek provider uses
not values.get("api_key")while other providers (lines 88, 93, 99-100) use"api_key" not in values. Although both work for this case, using thenot inpattern would be more consistent and explicit about checking key presence rather than truthiness.♻️ Optional consistency improvement
- if values.get("provider") == "deepseek" and not values.get("api_key"): + if values.get("provider") == "deepseek" and "api_key" not in values: deepseek_token = os.environ.get("DEEPSEEK_API_KEY") if deepseek_token: values["api_key"] = deepseek_token🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@coding-agent/src/coding_agent/core/config.py` around lines 106 - 109, Change the deepseek provider presence check to use the same explicit key-presence pattern as the other providers: replace the condition `not values.get("api_key")` with `"api_key" not in values` in the block that checks `values.get("provider") == "deepseek"`, and keep the rest (reading os.environ["DEEPSEEK_API_KEY"] into `deepseek_token` and setting `values["api_key"]`) unchanged so behavior matches the other provider branches.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@coding-agent/src/coding_agent/core/config.py`:
- Around line 106-109: Change the deepseek provider presence check to use the
same explicit key-presence pattern as the other providers: replace the condition
`not values.get("api_key")` with `"api_key" not in values` in the block that
checks `values.get("provider") == "deepseek"`, and keep the rest (reading
os.environ["DEEPSEEK_API_KEY"] into `deepseek_token` and setting
`values["api_key"]`) unchanged so behavior matches the other provider branches.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: fb6e6999-6380-4c2a-9ccc-0925fa44781c
📒 Files selected for processing (3)
coding-agent/src/coding_agent/core/config.pycoding-agent/src/coding_agent/ui/schemas.pycoding-agent/tests/ui/test_http_server.py
|
Review follow-up:
Validation:
|
|
Dogfood follow-up completed on PR #134. Findings from real DeepSeek production smoke:
Fixes pushed:
Dogfood smoke passed:
Validation:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
coding-agent/docs/remote-sandbox-production.md (1)
45-46: ⚡ Quick winConsider documenting runtime image dependency requirements.
The example shifted from a custom
coding-agent-runtimeimage to the standardpython:3.11-slimbase image, which is clearer for demonstration purposes. However, users may wonder whetherpython:3.11-slimincludes all dependencies required by the coding-agent tools (e.g., for bash_run, file operations, or other tool capabilities), or whether they should build a custom runtime image with additional tooling.Consider adding a brief note explaining:
- Whether
python:3.11-slimis sufficient for basic agent operations- What additional dependencies might be needed for specific tool capabilities
- When users should build a custom runtime image vs. using a base image
📝 Example clarification to add after line 46
image = "python:3.11-slim" image_allowlist = ["python:3.11-slim"] +# Note: python:3.11-slim provides a minimal baseline. Depending on your agent's +# tool usage, you may need a custom image with additional dependencies (e.g., +# git, build-essential, language-specific toolchains). exec_user = "1000:1000"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@coding-agent/docs/remote-sandbox-production.md` around lines 45 - 46, Add a short explanatory note after the image lines (image = "python:3.11-slim") stating whether python:3.11-slim is sufficient for basic agent operations (yes for pure-Python tools), list common extra dependencies users may need for specific tool capabilities (bash, shell utilities, git, curl, build-essential, ffmpeg, imagemagick, etc.), and give guidance on when to build a custom runtime image versus using the base image (i.e., build a custom image when you need non-Python system packages, compiled binaries, or faster startup with preinstalled tooling). Ensure this text appears as a brief bullet or paragraph immediately following the existing image configuration so readers can quickly see runtime dependency guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@coding-agent/docs/remote-sandbox-production.md`:
- Around line 45-46: Add a short explanatory note after the image lines (image =
"python:3.11-slim") stating whether python:3.11-slim is sufficient for basic
agent operations (yes for pure-Python tools), list common extra dependencies
users may need for specific tool capabilities (bash, shell utilities, git, curl,
build-essential, ffmpeg, imagemagick, etc.), and give guidance on when to build
a custom runtime image versus using the base image (i.e., build a custom image
when you need non-Python system packages, compiled binaries, or faster startup
with preinstalled tooling). Ensure this text appears as a brief bullet or
paragraph immediately following the existing image configuration so readers can
quickly see runtime dependency guidance.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b3ab6369-4b9e-430c-81e9-5f97aa7a0e90
📒 Files selected for processing (9)
coding-agent/docs/remote-sandbox-production.mdcoding-agent/src/coding_agent/__main__.pycoding-agent/src/coding_agent/plugins/llm_provider.pycoding-agent/src/coding_agent/providers/anthropic.pycoding-agent/src/coding_agent/ui/http_server.pycoding-agent/tests/cli/test_remote_client.pycoding-agent/tests/coding_agent/plugins/test_llm_provider.pycoding-agent/tests/providers/test_anthropic.pycoding-agent/tests/ui/test_http_server.py
✅ Files skipped from review due to trivial changes (2)
- coding-agent/tests/cli/test_remote_client.py
- coding-agent/src/coding_agent/main.py
🚧 Files skipped from review as they are similar to previous changes (1)
- coding-agent/tests/ui/test_http_server.py
Summary
Validation
Summary by CodeRabbit
New Features
Behavior Changes
Refactor
Documentation
Tests