feat(model-presets): pluggable model preset system + DS-V4/MiMo optimized prompts for Oracle, Explore, Librarian#4851
Open
EvangelosMoschou wants to merge 3 commits into
Conversation
…hains - Add buildDeepSeekV4SisyphusAgentConfig to sisyphus-agent-config.ts (thinking: 32000 for Pro, no thinking for Flash) - Add isDeepSeekV4Model routing to sisyphus-agent-factory.ts (DeepSeek-V4 → buildDeepSeekV4SisyphusAgentConfig with native prompt) - Add isMimoV25ProModel detector to model-family-detectors.ts - Re-export isDeepSeekV4FlashModel, isDeepSeekR1Model, isMimoV25ProModel in types.ts - Add deepseek-v4-pro to Sisyphus and Oracle fallback chains - Add deepseek-v4-flash to Librarian and Explore fallback chains
New core package: packages/model-presets/ - types.ts: ModelPreset interface (agent, model, promptKey, config, priority) - resolver.ts: resolveModelPreset() with scoring (exact=100, prefix=80, contains=60) - registry.ts: getBuiltinPresets() + PROMPT_KEYS - prompt-resolver.ts: maps PromptKey to prompt string Adding a new model = adding a registry entry. No if/else chains.
…mpts for Oracle, Explore, Librarian Uses the new packages/model-presets/ resolver. Adding a new model = adding a registry entry, not editing if/else chains in agent factories. Oracle: DEEPSEEK_V4_ORACLE_PROMPT, DEEPSEEK_V4_FLASH_ORACLE_PROMPT, MIMO_V25_ORACLE_PROMPT Explore: DEEPSEEK_V4_EXPLORE_PROMPT, DEEPSEEK_V4_FLASH_EXPLORE_PROMPT, MIMO_V25_EXPLORE_PROMPT Librarian: DEEPSEEK_V4_LIBRARIAN_PROMPT, DEEPSEEK_V4_FLASH_LIBRARIAN_PROMPT, MIMO_V25_LIBRARIAN_PROMPT Closes code-yeongyu#4745 (reunified from code-yeongyu#4807, code-yeongyu#4808, code-yeongyu#4809)
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.
Combined PR — model-presets + optimized prompts
Replaces #4357, #4807, #4808, #4809. This is the "hyperoptimised" version of the original #4745.
1.
packages/model-presets/— New core packageDecouples model-specific prompt/config optimization from agent source code. Instead of hardcoding
if (isDeepSeekV4Model) ...chains in every agent, model presets become data-driven registry entries.types.ts— ModelPreset interface (agent, model, promptKey, config, priority)resolver.ts—resolveModelPreset()with scoring (exact=100, prefix=80, contains=60)registry.ts—getBuiltinPresets()+PROMPT_KEYSprompt-resolver.ts— maps PromptKey to prompt string2. DeepSeek-V4 infrastructure
isDeepSeekV4Model,isDeepSeekV4ProModel,isDeepSeekV4FlashModel,isDeepSeekR1Model,isMimoV25ProModel3. Optimized prompts (3 agents × 3 variants = 9 prompts)
All presets use
resolveModelPreset()— no if/else chains. Adding a new model = adding a registry entry.Files changed
packages/model-presets/(5 new files),packages/model-core/(+detectors + fallbacks),src/agents/oracle.ts,src/agents/explore.ts,src/agents/librarian.ts,src/agents/sisyphus-*,src/agents/types.ts,package.jsonSummary by cubic
Introduces a pluggable model preset system and DS‑V4/MiMo‑optimized prompts for Oracle, Explore, and Librarian, replacing hardcoded branching and improving prompt efficiency. Adds DS‑V4 routing and thinking support with updated fallback chains for broader coverage.
New Features
@oh-my-opencode/model-presetswith presets registry, prompt resolver, and best-match resolution.buildDeepSeekV4SisyphusAgentConfig); adds DS‑V4 Pro/Flash to agent fallback chains.Migration
getBuiltinPresets()and map its prompt viacreatePromptResolver(); no agent code changes needed.Written for commit d845e71. Summary will update on new commits.