Skip to content

fix: route deepseek through openai compat - #399

Merged
delete-cloud merged 1 commit into
mainfrom
fix/deepseek-tool-continuation
May 30, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
fix/deepseek-tool-continuation

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • route provider=deepseek through the OpenAI-compatible provider instead of the Anthropic adapter
  • preserve DEEPSEEK_API_KEY fallback and base_url override support
  • update DeepSeek provider tests to cover the OpenAI-compatible endpoint

Verification

  • uv run pytest tests/providers/test_openai_compat.py tests/coding_agent/plugins/test_llm_provider.py::TestDeepSeekProvider tests/ui/test_http_server.py::TestSessionCreation::test_create_session_accepts_deepseek_runtime_provider tests/coding_agent/test_cli_pipeline.py::TestCliProviderChoices::test_top_level_accepts_deepseek_provider tests/coding_agent/test_cli_pipeline.py::TestCliProviderChoices::test_run_uses_deepseek_api_key_env_without_cli_api_key -q
  • uv run ruff check src/coding_agent/plugins/llm_provider.py tests/coding_agent/plugins/test_llm_provider.py
  • git diff --check -- .

Summary by CodeRabbit

  • Bug Fixes
    • Fixed DeepSeek provider integration to correctly manage API key sourcing from environment variables or explicit configuration, with proper base URL handling and defaults.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96206361-586a-4c68-a750-baa7b68d2a25

📥 Commits

Reviewing files that changed from the base of the PR and between b498c33 and 87bd14c.

📒 Files selected for processing (2)
  • coding-agent/src/coding_agent/plugins/llm_provider.py
  • coding-agent/tests/coding_agent/plugins/test_llm_provider.py

📝 Walkthrough

Walkthrough

DeepSeek provider integration is migrated from AnthropicProvider to OpenAICompatProvider. The implementation updates API key sourcing and base URL handling; tests are refactored to validate the new provider type and configuration behavior.

Changes

DeepSeek Provider Migration

Layer / File(s) Summary
DeepSeek provider wiring
coding-agent/src/coding_agent/plugins/llm_provider.py
The deepseek branch switches from AnthropicProvider to OpenAICompatProvider, updates API key selection to prefer self._api_key or DEEPSEEK_API_KEY, and changes base URL handling to use self._base_url when provided (otherwise defaulting to https://api.deepseek.com).
DeepSeek provider tests
coding-agent/tests/coding_agent/plugins/test_llm_provider.py
Test method renamed from test_deepseek_creates_anthropic_instance to test_deepseek_creates_openai_compat_instance; instance type, base URL behavior (including override handling), and API key source/priority tests updated to validate OpenAICompatProvider and _client state instead of Anthropic-specific behavior; Anthropic-specific tests removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • delete-cloud/Coding-Agent-Loop#85: Both PRs modify the same deepseek provider wiring and its DEEPSEEK_API_KEY/base URL handling in coding_agent/plugins/llm_provider.py and the corresponding TestDeepSeekProvider tests—feat: add deepseek provider support #85 routes deepseek to AnthropicProvider, while the main PR switches it to OpenAICompatProvider and updates assertions accordingly.
  • delete-cloud/Coding-Agent-Loop#134: Both PRs modify the DeepSeek "deepseek" provider handling in coding_agent/plugins/llm_provider.py (changing DeepSeek integration details) and update DeepSeek-related tests accordingly.

Poem

🐰 A DeepSeek once wandered astray,
From Anthropic's shadowed pathway,
Now OpenAI's compass guides true,
With keys from the environment's brew,
The tests now align with the new🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: route deepseek through openai compat' directly and concisely summarizes the main change: switching DeepSeek provider routing from Anthropic to OpenAI-compatible provider.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deepseek-tool-continuation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@delete-cloud
delete-cloud merged commit c797037 into main May 30, 2026
1 check passed
@delete-cloud
delete-cloud deleted the fix/deepseek-tool-continuation branch June 1, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant