feat(agents): add DeepSeek-V4 native support#3651
Open
gutierrezx7 wants to merge 1 commit intocode-yeongyu:devfrom
Open
feat(agents): add DeepSeek-V4 native support#3651gutierrezx7 wants to merge 1 commit intocode-yeongyu:devfrom
gutierrezx7 wants to merge 1 commit intocode-yeongyu:devfrom
Conversation
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
No issues found across 6 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Native support for DeepSeek-V4 is implemented as a new, isolated code path with specific model detection and comprehensive tests. No existing model logic is modified.
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
Author
|
I have read the CLA Document and I hereby sign the CLA recheck |
Add comprehensive support for DeepSeek-V4 models to enable users to leverage
DeepSeek's advanced agent capabilities within the OMO orchestration framework.
## Changes
### Model Detection (src/agents/types.ts)
- Add isDeepSeekV4Model() - detect any V4 variant
- Add isDeepSeekV4ProModel() - detect Pro with thinking support
- Add isDeepSeekV4FlashModel() - detect Flash for fast inference
- Add isDeepSeekR1Model() - detect R1 reasoning model (future use)
### Native Prompt (src/agents/sisyphus/deepseek-v4.ts)
- Create optimized prompt (~330 LOC vs ~540 default)
- Compact structure to avoid "lost in the middle" issues
- XML-tagged sections for clear parsing
- Phases: Intent → Tools → Implementation → Recovery → Completion
### Routing (src/agents/sisyphus.ts)
- Add V4-specific routing branch before default prompt
- V4-Pro: thinking enabled with 32k budget
- V4-Flash: optimized for speed without thinking
### Fallback Chains (src/shared/model-requirements.ts)
- Add deepseek-v4-pro to Sisyphus fallback chain
- Add deepseek-v4-pro to Oracle fallback chain
### Tests (src/agents/types.test.ts)
- Add 42 comprehensive test cases
- Cover provider-prefixed and providerless models
- Test variant separation (Pro vs Flash)
- Test negative cases (V3, R1, other models)
## Why Native Prompt?
Unlike Gemini which requires corrective overlays, DeepSeek-V4:
- Follows system prompts correctly (unlike R1)
- Has native tool calling with strict mode support
- Doesn't hallucinate tool calls
- Benefits from compact, well-structured prompts
## Usage
Configure in oh-my-opencode.jsonc:
{
"agents": {
"sisyphus": {
"model": "llmgateway/deepseek-v4-pro"
}
}
}
## Testing
- All 42 new tests pass
- Build succeeds (1295 modules)
- TypeScript type checking passes
- Schema JSON regenerated
Refs: code-yeongyu#2072
Related: code-yeongyu#3517 (follows same GLM overlay pattern)
0232836 to
b12bab0
Compare
Author
|
recheck |
rustybret
pushed a commit
to rustybret/agent-harness
that referenced
this pull request
Apr 27, 2026
|
Waiting for this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DeepSeek-V4 Support Implementation
Summary
This PR adds native support for DeepSeek-V4 models to oh-my-openagent, enabling users to leverage DeepSeek's advanced agent capabilities within the OMO orchestration framework.
Problem Statement
Users of oh-my-openagent (OMO) who wanted to use DeepSeek-V4 faced compatibility issues:
Solution
1. Model Detection (
src/agents/types.ts)Added four detection functions to properly identify DeepSeek model variants:
Design rationale: Separate detection functions allow granular control over model-specific features (e.g., thinking mode for Pro only).
2. Native Prompt (
src/agents/sisyphus/deepseek-v4.ts)Created a purpose-built prompt for DeepSeek-V4 with the following optimizations:
Key sections:
3. Routing Logic (
src/agents/sisyphus.ts)Added V4-specific routing in
createSisyphusAgent():Configuration:
thinking: { type: "enabled", budgetTokens: 32000 }4. Fallback Chains (
src/shared/model-requirements.ts)Added DeepSeek-V4-Pro to agent fallback chains:
Sisyphus:
Oracle:
5. Test Coverage (
src/agents/types.test.ts)Added comprehensive tests (42 test cases):
llmgateway/deepseek-v4-prodeepseek-v4-proTechnical Decisions
Why Native Prompt Instead of Overlays?
DeepSeek-V4 differs from Gemini in key ways:
A native prompt allows better optimization for V4's architecture than injecting overlays into a generic prompt.
Why Not Support R1 in This PR?
DeepSeek-R1 has fundamentally different requirements:
Supporting R1 requires architectural changes beyond this PR's scope.
Why Thinking Instead of reasoningEffort?
reasoningEffortis OpenAI-specificthinkingwith budget tokensUsage
Configuration
Add to
oh-my-opencode.jsonc:{ "agents": { "sisyphus": { "model": "llmgateway/deepseek-v4-pro" } } }Or use via LLM Gateway:
{ "agents": { "sisyphus": { "model": "llmgateway/deepseek-v4-pro" } } }Available Models
deepseek-v4-prodeepseek-v4-flashTesting
All tests pass:
$ bun test src/agents/types.test.ts 42 pass 0 failBuild succeeds:
Checklist
References
Related
Closes #2072 (partially - V4 support, R1 deferred to future PR)
Codesmith can help with this PR, just tag
@codesmithor enable autofix. Settings.Summary by cubic
Adds native DeepSeek-V4 support to Sisyphus with a compact, V4-optimized prompt and model-aware routing. Improves orchestration quality and adds
deepseek-v4-proto Sisyphus and Oracle fallback chains.New Features
deepseek-v4variants (pro,flash) and adds anr1detector for future use.thinkingfordeepseek-v4-pro(32k budget). NoreasoningEffort.deepseek-v4-pro.Migration
agents.sisyphus.modeltollmgateway/deepseek-v4-pro(quality) ordeepseek-v4-flash(speed).Written for commit b12bab0. Summary will update on new commits.