Skip to content

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
code-yeongyu:devfrom
EvangelosMoschou:feat/dsv4-mimo-combined
Open

feat(model-presets): pluggable model preset system + DS-V4/MiMo optimized prompts for Oracle, Explore, Librarian#4851
EvangelosMoschou wants to merge 3 commits into
code-yeongyu:devfrom
EvangelosMoschou:feat/dsv4-mimo-combined

Conversation

@EvangelosMoschou
Copy link
Copy Markdown

@EvangelosMoschou EvangelosMoschou commented Jun 5, 2026

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 package

Decouples 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.tsresolveModelPreset() with scoring (exact=100, prefix=80, contains=60)
  • registry.tsgetBuiltinPresets() + PROMPT_KEYS
  • prompt-resolver.ts — maps PromptKey to prompt string

2. DeepSeek-V4 infrastructure

  • Model detectors: isDeepSeekV4Model, isDeepSeekV4ProModel, isDeepSeekV4FlashModel, isDeepSeekR1Model, isMimoV25ProModel
  • Sisyphus routing: DS-V4 → native prompt + conditional thinking (32k budget for Pro)
  • Fallback chains: Oracle/Librarian/Explore get DS-V4 entries

3. Optimized prompts (3 agents × 3 variants = 9 prompts)

Agent DS-V4 Pro DS-V4 Flash MiMo V2.5 Pro
Oracle -24% tokens, XML-tagged, thinking 32k -47%, ultra-compact, no thinking -2%, Thinking_Strategy section
Explore -4%, XML-tagged, thinking 32k -52%, ~50 lines +1%, Tool_Examples for hybrid attention
Librarian -45%, full structured, thinking 32k -62%, ~80 lines -50%, clustered hybrid attention

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.json


Summary 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

    • New core package @oh-my-opencode/model-presets with presets registry, prompt resolver, and best-match resolution.
    • Oracle, Explore, Librarian now use presets; ship DS‑V4 Pro/Flash and MiMo V2.5 Pro optimized prompts; DS‑V4 Pro enables 32k thinking.
    • DS‑V4 detectors and Sisyphus routing (buildDeepSeekV4SisyphusAgentConfig); adds DS‑V4 Pro/Flash to agent fallback chains.
  • Migration

    • No breaking changes.
    • To add a model: add a preset in getBuiltinPresets() and map its prompt via createPromptResolver(); no agent code changes needed.

Written for commit d845e71. Summary will update on new commits.

Review in cubic

…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lazycodex LazyCodex and omo-codex related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant