oh-my-opencode 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5355,6 +5355,10 @@ function resolveModelWithFallback(input) {
5355
5355
  }
5356
5356
  log("No available model found in fallback chain, falling through to system default");
5357
5357
  }
5358
+ if (systemDefaultModel === undefined) {
5359
+ log("No model resolved - systemDefaultModel not configured");
5360
+ return;
5361
+ }
5358
5362
  log("Model resolved via system default", { model: systemDefaultModel });
5359
5363
  return { model: systemDefaultModel, source: "system-default" };
5360
5364
  }
@@ -7703,6 +7707,12 @@ var init_auto_update_checker = __esm(() => {
7703
7707
  });
7704
7708
 
7705
7709
  // src/tools/delegate-task/constants.ts
7710
+ function isPlanAgent(agentName) {
7711
+ if (!agentName)
7712
+ return false;
7713
+ const lowerName = agentName.toLowerCase().trim();
7714
+ return PLAN_AGENT_NAMES.some((name) => lowerName === name || lowerName.includes(name));
7715
+ }
7706
7716
  var VISUAL_CATEGORY_PROMPT_APPEND = `<Category_Context>
7707
7717
  You are working on VISUAL/UI tasks.
7708
7718
 
@@ -7842,7 +7852,215 @@ Approach:
7842
7852
  - Draft with care
7843
7853
  - Polish for clarity and impact
7844
7854
  - Documentation, READMEs, articles, technical writing
7845
- </Category_Context>`, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS;
7855
+ </Category_Context>`, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS, PLAN_AGENT_SYSTEM_PREPEND = `<system>
7856
+ BEFORE you begin planning, you MUST first understand the user's request deeply.
7857
+
7858
+ MANDATORY CONTEXT GATHERING PROTOCOL:
7859
+ 1. Launch background agents to gather context:
7860
+ - call_omo_agent(description="Explore codebase patterns", subagent_type="explore", run_in_background=true, prompt="<search for relevant patterns, files, and implementations in the codebase related to user's request>")
7861
+ - call_omo_agent(description="Research documentation", subagent_type="librarian", run_in_background=true, prompt="<search for external documentation, examples, and best practices related to user's request>")
7862
+
7863
+ 2. After gathering context, ALWAYS present:
7864
+ - **User Request Summary**: Concise restatement of what the user is asking for
7865
+ - **Uncertainties**: List of unclear points, ambiguities, or assumptions you're making
7866
+ - **Clarifying Questions**: Specific questions to resolve the uncertainties
7867
+
7868
+ 3. ITERATE until ALL requirements are crystal clear:
7869
+ - Do NOT proceed to planning until you have 100% clarity
7870
+ - Ask the user to confirm your understanding
7871
+ - Resolve every ambiguity before generating the work plan
7872
+
7873
+ REMEMBER: Vague requirements lead to failed implementations. Take the time to understand thoroughly.
7874
+ </system>
7875
+
7876
+ <CRITICAL_REQUIREMENT_DEPENDENCY_PARALLEL_EXECUTION_CATEGORY_SKILLS>
7877
+ #####################################################################
7878
+ # #
7879
+ # \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 #
7880
+ # \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 #
7881
+ # \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 #
7882
+ # \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 #
7883
+ # \u2588\u2588\uFFFD\uFFFD \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D #
7884
+ # \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D #
7885
+ # #
7886
+ #####################################################################
7887
+
7888
+ YOU MUST INCLUDE THE FOLLOWING SECTIONS IN YOUR PLAN OUTPUT.
7889
+ THIS IS NON-NEGOTIABLE. FAILURE TO INCLUDE THESE SECTIONS = INCOMPLETE PLAN.
7890
+
7891
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
7892
+ \u2588 SECTION 1: TASK DEPENDENCY GRAPH (MANDATORY) \u2588
7893
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
7894
+
7895
+ YOU MUST ANALYZE AND DOCUMENT TASK DEPENDENCIES.
7896
+
7897
+ For EVERY task in your plan, you MUST specify:
7898
+ - Which tasks it DEPENDS ON (blockers)
7899
+ - Which tasks DEPEND ON IT (dependents)
7900
+ - The REASON for each dependency
7901
+
7902
+ Example format:
7903
+ \`\`\`
7904
+ ## Task Dependency Graph
7905
+
7906
+ | Task | Depends On | Reason |
7907
+ |------|------------|--------|
7908
+ | Task 1 | None | Starting point, no prerequisites |
7909
+ | Task 2 | Task 1 | Requires output/artifact from Task 1 |
7910
+ | Task 3 | Task 1 | Uses same foundation established in Task 1 |
7911
+ | Task 4 | Task 2, Task 3 | Integrates results from both tasks |
7912
+ \`\`\`
7913
+
7914
+ WHY THIS MATTERS:
7915
+ - Executors need to know execution ORDER
7916
+ - Prevents blocked work from starting prematurely
7917
+ - Identifies critical path for project timeline
7918
+
7919
+
7920
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
7921
+ \u2588 SECTION 2: PARALLEL EXECUTION GRAPH (MANDATORY) \u2588
7922
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
7923
+
7924
+ YOU MUST IDENTIFY WHICH TASKS CAN RUN IN PARALLEL.
7925
+
7926
+ Analyze your dependency graph and group tasks into PARALLEL EXECUTION WAVES:
7927
+
7928
+ Example format:
7929
+ \`\`\`
7930
+ ## Parallel Execution Graph
7931
+
7932
+ Wave 1 (Start immediately):
7933
+ \u251C\u2500\u2500 Task 1: [description] (no dependencies)
7934
+ \u2514\u2500\u2500 Task 5: [description] (no dependencies)
7935
+
7936
+ Wave 2 (After Wave 1 completes):
7937
+ \u251C\u2500\u2500 Task 2: [description] (depends: Task 1)
7938
+ \u251C\u2500\u2500 Task 3: [description] (depends: Task 1)
7939
+ \u2514\u2500\u2500 Task 6: [description] (depends: Task 5)
7940
+
7941
+ Wave 3 (After Wave 2 completes):
7942
+ \u2514\u2500\u2500 Task 4: [description] (depends: Task 2, Task 3)
7943
+
7944
+ Critical Path: Task 1 \u2192 Task 2 \u2192 Task 4
7945
+ Estimated Parallel Speedup: 40% faster than sequential
7946
+ \`\`\`
7947
+
7948
+ WHY THIS MATTERS:
7949
+ - MASSIVE time savings through parallelization
7950
+ - Executors can dispatch multiple agents simultaneously
7951
+ - Identifies bottlenecks in the execution plan
7952
+
7953
+
7954
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
7955
+ \u2588 SECTION 3: CATEGORY + SKILLS RECOMMENDATIONS (MANDATORY) \u2588
7956
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
7957
+
7958
+ FOR EVERY TASK, YOU MUST RECOMMEND:
7959
+ 1. Which CATEGORY to use for delegation
7960
+ 2. Which SKILLS to load for the delegated agent
7961
+
7962
+ ### AVAILABLE CATEGORIES
7963
+
7964
+ | Category | Best For | Model |
7965
+ |----------|----------|-------|
7966
+ | \`visual-engineering\` | Frontend, UI/UX, design, styling, animation | google/gemini-3-pro |
7967
+ | \`ultrabrain\` | Complex architecture, deep logical reasoning | openai/gpt-5.2-codex |
7968
+ | \`artistry\` | Highly creative/artistic tasks, novel ideas | google/gemini-3-pro |
7969
+ | \`quick\` | Trivial tasks - single file, typo fixes | anthropic/claude-haiku-4-5 |
7970
+ | \`unspecified-low\` | Moderate effort, doesn't fit other categories | anthropic/claude-sonnet-4-5 |
7971
+ | \`unspecified-high\` | High effort, doesn't fit other categories | anthropic/claude-opus-4-5 |
7972
+ | \`writing\` | Documentation, prose, technical writing | google/gemini-3-flash |
7973
+
7974
+ ### AVAILABLE SKILLS (ALWAYS EVALUATE ALL)
7975
+
7976
+ Skills inject specialized expertise into the delegated agent.
7977
+ YOU MUST evaluate EVERY skill and justify inclusions/omissions.
7978
+
7979
+ | Skill | Domain |
7980
+ |-------|--------|
7981
+ | \`agent-browser\` | Browser automation, web testing |
7982
+ | \`frontend-ui-ux\` | Stunning UI/UX design |
7983
+ | \`git-master\` | Atomic commits, git operations |
7984
+ | \`dev-browser\` | Persistent browser state automation |
7985
+ | \`typescript-programmer\` | Production TypeScript code |
7986
+ | \`python-programmer\` | Production Python code |
7987
+ | \`svelte-programmer\` | Svelte components |
7988
+ | \`golang-tui-programmer\` | Go TUI with Charmbracelet |
7989
+ | \`python-debugger\` | Interactive Python debugging |
7990
+ | \`data-scientist\` | DuckDB/Polars data processing |
7991
+ | \`prompt-engineer\` | AI prompt optimization |
7992
+
7993
+ ### REQUIRED OUTPUT FORMAT
7994
+
7995
+ For EACH task, include a recommendation block:
7996
+
7997
+ \`\`\`
7998
+ ### Task N: [Task Title]
7999
+
8000
+ **Delegation Recommendation:**
8001
+ - Category: \`[category-name]\` - [reason for choice]
8002
+ - Skills: [\`skill-1\`, \`skill-2\`] - [reason each skill is needed]
8003
+
8004
+ **Skills Evaluation:**
8005
+ - INCLUDED \`skill-name\`: [reason]
8006
+ - OMITTED \`other-skill\`: [reason domain doesn't overlap]
8007
+ \`\`\`
8008
+
8009
+ WHY THIS MATTERS:
8010
+ - Category determines the MODEL used for execution
8011
+ - Skills inject SPECIALIZED KNOWLEDGE into the executor
8012
+ - Missing a relevant skill = suboptimal execution
8013
+ - Wrong category = wrong model = poor results
8014
+
8015
+
8016
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
8017
+ \u2588 RESPONSE FORMAT SPECIFICATION (MANDATORY) \u2588
8018
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
8019
+
8020
+ YOUR PLAN OUTPUT MUST FOLLOW THIS EXACT STRUCTURE:
8021
+
8022
+ \`\`\`markdown
8023
+ # [Plan Title]
8024
+
8025
+ ## Context
8026
+ [User request summary, interview findings, research results]
8027
+
8028
+ ## Task Dependency Graph
8029
+ [Dependency table - see Section 1]
8030
+
8031
+ ## Parallel Execution Graph
8032
+ [Wave structure - see Section 2]
8033
+
8034
+ ## Tasks
8035
+
8036
+ ### Task 1: [Title]
8037
+ **Description**: [What to do]
8038
+ **Delegation Recommendation**:
8039
+ - Category: \`[category]\` - [reason]
8040
+ - Skills: [\`skill-1\`] - [reason]
8041
+ **Skills Evaluation**: [\u2705 included / \u274C omitted with reasons]
8042
+ **Depends On**: [Task IDs or "None"]
8043
+ **Acceptance Criteria**: [Verifiable conditions]
8044
+
8045
+ ### Task 2: [Title]
8046
+ [Same structure...]
8047
+
8048
+ ## Commit Strategy
8049
+ [How to commit changes atomically]
8050
+
8051
+ ## Success Criteria
8052
+ [Final verification steps]
8053
+ \`\`\`
8054
+
8055
+ #####################################################################
8056
+ # #
8057
+ # FAILURE TO INCLUDE THESE SECTIONS = PLAN WILL BE REJECTED #
8058
+ # BY MOMUS REVIEW. DO NOT SKIP. DO NOT ABBREVIATE. #
8059
+ # #
8060
+ #####################################################################
8061
+ </CRITICAL_REQUIREMENT_DEPENDENCY_PARALLEL_EXECUTION_CATEGORY_SKILLS>
8062
+
8063
+ `, PLAN_AGENT_NAMES;
7846
8064
  var init_constants4 = __esm(() => {
7847
8065
  DEFAULT_CATEGORIES = {
7848
8066
  "visual-engineering": { model: "google/gemini-3-pro" },
@@ -7871,6 +8089,7 @@ var init_constants4 = __esm(() => {
7871
8089
  "unspecified-high": "Tasks that don't fit other categories, high effort required",
7872
8090
  writing: "Documentation, prose, technical writing"
7873
8091
  };
8092
+ PLAN_AGENT_NAMES = ["plan", "prometheus", "planner"];
7874
8093
  });
7875
8094
 
7876
8095
  // node_modules/ajv/dist/compile/codegen/code.js
@@ -17998,13 +18217,30 @@ function createThinkModeHook() {
17998
18217
  });
17999
18218
  }
18000
18219
  if (thinkingConfig) {
18001
- Object.assign(output.message, thinkingConfig);
18002
- state2.thinkingConfigInjected = true;
18003
- log("Think mode: thinking config injected", {
18004
- sessionID,
18005
- provider: currentModel.providerID,
18006
- config: thinkingConfig
18007
- });
18220
+ const messageData = output.message;
18221
+ const agentThinking = messageData.thinking;
18222
+ const agentProviderOptions = messageData.providerOptions;
18223
+ const agentDisabledThinking = agentThinking?.type === "disabled";
18224
+ const agentHasCustomProviderOptions = Boolean(agentProviderOptions);
18225
+ if (agentDisabledThinking) {
18226
+ log("Think mode: skipping - agent has thinking disabled", {
18227
+ sessionID,
18228
+ provider: currentModel.providerID
18229
+ });
18230
+ } else if (agentHasCustomProviderOptions) {
18231
+ log("Think mode: skipping - agent has custom providerOptions", {
18232
+ sessionID,
18233
+ provider: currentModel.providerID
18234
+ });
18235
+ } else {
18236
+ Object.assign(output.message, thinkingConfig);
18237
+ state2.thinkingConfigInjected = true;
18238
+ log("Think mode: thinking config injected", {
18239
+ sessionID,
18240
+ provider: currentModel.providerID,
18241
+ config: thinkingConfig
18242
+ });
18243
+ }
18008
18244
  }
18009
18245
  thinkModeState.set(sessionID, state2);
18010
18246
  },
@@ -19906,34 +20142,110 @@ delegate_task(agent="oracle", prompt="Review my approach: [describe plan]")
19906
20142
  YOU MUST LEVERAGE ALL AVAILABLE AGENTS / **CATEGORY + SKILLS** TO THEIR FULLEST POTENTIAL.
19907
20143
  TELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.
19908
20144
 
19909
- ## AGENTS / **CATEGORY + SKILLS** UTILIZATION PRINCIPLES (by capability, not by name)
19910
- - **Codebase Exploration**: Spawn exploration agents using BACKGROUND TASKS for file patterns, internal implementations, project structure
19911
- - **Documentation & References**: Use librarian-type agents via BACKGROUND TASKS for API references, examples, external library docs
19912
- - **Planning & Strategy**: NEVER plan yourself - ALWAYS spawn the Plan agent for work breakdown
19913
- - MUST invoke: \`delegate_task(subagent_type="plan", prompt="<gathered context + user request>")\`
19914
- - In your prompt to the Plan agent, ASK it to recommend which CATEGORY + SKILLS / AGENTS to leverage for implementation.
19915
- - IF IMPLEMENT TASK, MUST ADD TODO NOW: "Consult Plan agent via delegate_task(subagent_type='plan') for work breakdown with category + skills recommendations"
19916
- - **High-IQ Reasoning**: Leverage specialized agents for architecture decisions, code review, strategic planning
19917
- - **SPECIAL TASKS COVERED WITH CATEGORY + LOAD_SKILLS**: Delegate to specialized agents with category+skills for design and implementation, as following guide:
19918
- - CATEGORY + SKILL GUIDE
19919
- - MUST PASS \`load_skills\` FOR REQUIRED_SKILLS. MUST USE \`load_skills\` FOR REQUIRED_SKILLS.
19920
- - Simple project setup -> delegate_task(category="unspecified-low", load_skills=[{project-setup-skill}])
19921
- - Super Complex Server Workflow Implementation -> delegate_task(category="ultrabrain", load_skills=["terraform-master"], ...)
19922
- - Web Frontend Component Writing -> delegate_task(category="visual-engineering", load_skills=["frontend-ui-ux", "playwright"], ...)
19923
-
19924
- ## EXECUTION RULES
19925
- - **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each.
19926
- - **PARALLEL**: Fire independent agent calls simultaneously via delegate_task(background=true) - NEVER wait sequentially.
19927
- - **BACKGROUND FIRST**: Use delegate_task for exploration/research agents (10+ concurrent if needed).
19928
- - **VERIFY**: Re-read request after completion. Check ALL requirements met before reporting done.
19929
- - **DELEGATE**: Don't do everything yourself - orchestrate specialized agents for their strengths.
19930
- - **CATEGORY + LOAD_SKILLS**
19931
-
19932
- ## WORKFLOW
19933
- 1. Analyze the request and identify required capabilities
19934
- 2. Spawn exploration/librarian agents via delegate_task(background=true) in PARALLEL (10+ if needed)
19935
- 3. Spawn Plan agent: \`delegate_task(subagent_type="plan", prompt="<context + request>")\` to create detailed work breakdown
19936
- 4. Execute with continuous verification against original requirements
20145
+ ## MANDATORY: PLAN AGENT INVOCATION (NON-NEGOTIABLE)
20146
+
20147
+ **YOU MUST ALWAYS INVOKE THE PLAN AGENT FOR ANY NON-TRIVIAL TASK.**
20148
+
20149
+ | Condition | Action |
20150
+ |-----------|--------|
20151
+ | Task has 2+ steps | MUST call Plan agent |
20152
+ | Task scope unclear | MUST call Plan agent |
20153
+ | Implementation required | MUST call Plan agent |
20154
+ | Architecture decision needed | MUST call Plan agent |
20155
+
20156
+ \`\`\`
20157
+ delegate_task(subagent_type="plan", prompt="<gathered context + user request>")
20158
+ \`\`\`
20159
+
20160
+ **WHY THIS IS MANDATORY:**
20161
+ - Plan agent analyzes dependencies and parallel execution opportunities
20162
+ - Plan agent recommends CATEGORY + SKILLS for each task
20163
+ - Plan agent ensures nothing is missed
20164
+ - YOU are an orchestrator, NOT an implementer
20165
+
20166
+ **FAILURE TO CALL PLAN AGENT = INCOMPLETE WORK.**
20167
+
20168
+ ---
20169
+
20170
+ ## AGENTS / **CATEGORY + SKILLS** UTILIZATION PRINCIPLES
20171
+
20172
+ **DEFAULT BEHAVIOR: DELEGATE. DO NOT WORK YOURSELF.**
20173
+
20174
+ | Task Type | Action | Why |
20175
+ |-----------|--------|-----|
20176
+ | Codebase exploration | delegate_task(subagent_type="explore", run_in_background=true) | Parallel, context-efficient |
20177
+ | Documentation lookup | delegate_task(subagent_type="librarian", run_in_background=true) | Specialized knowledge |
20178
+ | Planning | delegate_task(subagent_type="plan") | Structured work breakdown |
20179
+ | Architecture/Debugging | delegate_task(subagent_type="oracle") | High-IQ reasoning |
20180
+ | Implementation | delegate_task(category="...", load_skills=[...]) | Domain-optimized models |
20181
+
20182
+ **CATEGORY + SKILL DELEGATION:**
20183
+ \`\`\`
20184
+ // Frontend work
20185
+ delegate_task(category="visual-engineering", load_skills=["frontend-ui-ux"])
20186
+
20187
+ // Complex logic
20188
+ delegate_task(category="ultrabrain", load_skills=["typescript-programmer"])
20189
+
20190
+ // Quick fixes
20191
+ delegate_task(category="quick", load_skills=["git-master"])
20192
+ \`\`\`
20193
+
20194
+ **YOU SHOULD ONLY DO IT YOURSELF WHEN:**
20195
+ - Task is trivially simple (1-2 lines, obvious change)
20196
+ - You have ALL context already loaded
20197
+ - Delegation overhead exceeds task complexity
20198
+
20199
+ **OTHERWISE: DELEGATE. ALWAYS.**
20200
+
20201
+ ---
20202
+
20203
+ ## EXECUTION RULES (PARALLELIZATION MANDATORY)
20204
+
20205
+ | Rule | Implementation |
20206
+ |------|----------------|
20207
+ | **PARALLEL FIRST** | Fire ALL independent agents simultaneously via delegate_task(run_in_background=true) |
20208
+ | **NEVER SEQUENTIAL** | If tasks A and B are independent, launch BOTH at once |
20209
+ | **10+ CONCURRENT** | Use 10+ background agents if needed for comprehensive exploration |
20210
+ | **COLLECT LATER** | Launch agents -> continue work -> background_output when needed |
20211
+
20212
+ **ANTI-PATTERN (BLOCKING):**
20213
+ \`\`\`
20214
+ // WRONG: Sequential, slow
20215
+ result1 = delegate_task(..., run_in_background=false) // waits
20216
+ result2 = delegate_task(..., run_in_background=false) // waits again
20217
+ \`\`\`
20218
+
20219
+ **CORRECT PATTERN:**
20220
+ \`\`\`
20221
+ // RIGHT: Parallel, fast
20222
+ delegate_task(..., run_in_background=true) // task_id_1
20223
+ delegate_task(..., run_in_background=true) // task_id_2
20224
+ delegate_task(..., run_in_background=true) // task_id_3
20225
+ // Continue working, collect with background_output when needed
20226
+ \`\`\`
20227
+
20228
+ ---
20229
+
20230
+ ## WORKFLOW (MANDATORY SEQUENCE)
20231
+
20232
+ 1. **GATHER CONTEXT** (parallel background agents):
20233
+ \`\`\`
20234
+ delegate_task(subagent_type="explore", run_in_background=true, prompt="...")
20235
+ delegate_task(subagent_type="librarian", run_in_background=true, prompt="...")
20236
+ \`\`\`
20237
+
20238
+ 2. **INVOKE PLAN AGENT** (MANDATORY for non-trivial tasks):
20239
+ \`\`\`
20240
+ delegate_task(subagent_type="plan", prompt="<context + request>")
20241
+ \`\`\`
20242
+
20243
+ 3. **EXECUTE VIA DELEGATION** (category + skills):
20244
+ \`\`\`
20245
+ delegate_task(category="...", load_skills=[...], prompt="<task from plan>")
20246
+ \`\`\`
20247
+
20248
+ 4. **VERIFY** against original requirements
19937
20249
 
19938
20250
  ## VERIFICATION GUARANTEE (NON-NEGOTIABLE)
19939
20251
 
@@ -43756,16 +44068,24 @@ function resolveCategoryConfig(categoryName, options) {
43756
44068
  return { config: config3, promptAppend, model };
43757
44069
  }
43758
44070
  function buildSystemContent(input) {
43759
- const { skillContent, categoryPromptAppend } = input;
43760
- if (!skillContent && !categoryPromptAppend) {
44071
+ const { skillContent, categoryPromptAppend, agentName } = input;
44072
+ const planAgentPrepend = isPlanAgent(agentName) ? PLAN_AGENT_SYSTEM_PREPEND : "";
44073
+ if (!skillContent && !categoryPromptAppend && !planAgentPrepend) {
43761
44074
  return;
43762
44075
  }
43763
- if (skillContent && categoryPromptAppend) {
43764
- return `${skillContent}
43765
-
43766
- ${categoryPromptAppend}`;
44076
+ const parts = [];
44077
+ if (planAgentPrepend) {
44078
+ parts.push(planAgentPrepend);
44079
+ }
44080
+ if (skillContent) {
44081
+ parts.push(skillContent);
43767
44082
  }
43768
- return skillContent || categoryPromptAppend;
44083
+ if (categoryPromptAppend) {
44084
+ parts.push(categoryPromptAppend);
44085
+ }
44086
+ return parts.join(`
44087
+
44088
+ `) || undefined;
43769
44089
  }
43770
44090
  function createDelegateTask(options) {
43771
44091
  const { manager, client: client2, directory, userCategories, gitMasterConfig, sisyphusJuniorModel, browserProvider, onSyncSessionCreated } = options;
@@ -43942,7 +44262,8 @@ Use \`background_output\` with task_id="${task.id}" to check progress.`;
43942
44262
  ...resumeAgent ? getAgentToolRestrictions(resumeAgent) : {},
43943
44263
  task: false,
43944
44264
  delegate_task: false,
43945
- call_omo_agent: true
44265
+ call_omo_agent: true,
44266
+ question: false
43946
44267
  },
43947
44268
  parts: [{ type: "text", text: args.prompt }]
43948
44269
  }
@@ -44035,16 +44356,6 @@ To continue this session: session_id="${args.session_id}"`;
44035
44356
  const inheritedModel = parentModel ? `${parentModel.providerID}/${parentModel.modelID}` : undefined;
44036
44357
  let modelInfo;
44037
44358
  if (args.category) {
44038
- if (!systemDefaultModel) {
44039
- const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
44040
- return `oh-my-opencode requires a default model.
44041
-
44042
- ` + `Add this to ${paths.configJsonc}:
44043
-
44044
- ` + ` "model": "anthropic/claude-sonnet-4-5"
44045
-
44046
- ` + "(Replace with your preferred provider/model)";
44047
- }
44048
44359
  const connectedProviders = readConnectedProvidersCache();
44049
44360
  const availableModels = await fetchAvailableModels(client2, {
44050
44361
  connectedProviders: connectedProviders ?? undefined
@@ -44061,42 +44372,47 @@ To continue this session: session_id="${args.session_id}"`;
44061
44372
  let actualModel;
44062
44373
  if (!requirement) {
44063
44374
  actualModel = resolved.model;
44064
- modelInfo = { model: actualModel, type: "system-default", source: "system-default" };
44375
+ if (actualModel) {
44376
+ modelInfo = { model: actualModel, type: "system-default", source: "system-default" };
44377
+ }
44065
44378
  } else {
44066
- const { model: resolvedModel, source, variant: resolvedVariant } = resolveModelWithFallback({
44379
+ const resolution = resolveModelWithFallback({
44067
44380
  userModel: userCategories?.[args.category]?.model ?? sisyphusJuniorModel,
44068
44381
  fallbackChain: requirement.fallbackChain,
44069
44382
  availableModels,
44070
44383
  systemDefaultModel
44071
44384
  });
44072
- actualModel = resolvedModel;
44073
- if (!parseModelString(actualModel)) {
44074
- return `Invalid model format "${actualModel}". Expected "provider/model" format (e.g., "anthropic/claude-sonnet-4-5").`;
44075
- }
44076
- let type2;
44077
- switch (source) {
44078
- case "override":
44079
- type2 = "user-defined";
44080
- break;
44081
- case "provider-fallback":
44082
- type2 = "category-default";
44083
- break;
44084
- case "system-default":
44085
- type2 = "system-default";
44086
- break;
44385
+ if (resolution) {
44386
+ const { model: resolvedModel, source, variant: resolvedVariant } = resolution;
44387
+ actualModel = resolvedModel;
44388
+ if (!parseModelString(actualModel)) {
44389
+ return `Invalid model format "${actualModel}". Expected "provider/model" format (e.g., "anthropic/claude-sonnet-4-5").`;
44390
+ }
44391
+ let type2;
44392
+ switch (source) {
44393
+ case "override":
44394
+ type2 = "user-defined";
44395
+ break;
44396
+ case "provider-fallback":
44397
+ type2 = "category-default";
44398
+ break;
44399
+ case "system-default":
44400
+ type2 = "system-default";
44401
+ break;
44402
+ }
44403
+ modelInfo = { model: actualModel, type: type2, source };
44404
+ const parsedModel = parseModelString(actualModel);
44405
+ const variantToUse = userCategories?.[args.category]?.variant ?? resolvedVariant;
44406
+ categoryModel = parsedModel ? variantToUse ? { ...parsedModel, variant: variantToUse } : parsedModel : undefined;
44087
44407
  }
44088
- modelInfo = { model: actualModel, type: type2, source };
44089
- const parsedModel = parseModelString(actualModel);
44090
- const variantToUse = userCategories?.[args.category]?.variant ?? resolvedVariant;
44091
- categoryModel = parsedModel ? variantToUse ? { ...parsedModel, variant: variantToUse } : parsedModel : undefined;
44092
44408
  }
44093
44409
  agentToUse = SISYPHUS_JUNIOR_AGENT;
44094
- if (!categoryModel) {
44410
+ if (!categoryModel && actualModel) {
44095
44411
  const parsedModel = parseModelString(actualModel);
44096
44412
  categoryModel = parsedModel ?? undefined;
44097
44413
  }
44098
44414
  categoryPromptAppend = resolved.promptAppend || undefined;
44099
- const isUnstableAgent = resolved.config.is_unstable_agent === true || actualModel.toLowerCase().includes("gemini");
44415
+ const isUnstableAgent = resolved.config.is_unstable_agent === true || (actualModel?.toLowerCase().includes("gemini") ?? false);
44100
44416
  const isRunInBackgroundExplicitlyFalse = args.run_in_background === false || args.run_in_background === "false";
44101
44417
  log("[delegate_task] unstable agent detection", {
44102
44418
  category: args.category,
@@ -44108,7 +44424,7 @@ To continue this session: session_id="${args.session_id}"`;
44108
44424
  willForceBackground: isUnstableAgent && isRunInBackgroundExplicitlyFalse
44109
44425
  });
44110
44426
  if (isUnstableAgent && isRunInBackgroundExplicitlyFalse) {
44111
- const systemContent2 = buildSystemContent({ skillContent, categoryPromptAppend });
44427
+ const systemContent2 = buildSystemContent({ skillContent, categoryPromptAppend, agentName: agentToUse });
44112
44428
  try {
44113
44429
  const task = await manager.launch({
44114
44430
  description: args.description,
@@ -44264,7 +44580,7 @@ Sisyphus-Junior is spawned automatically when you specify a category. Pick the a
44264
44580
  agentToUse = matchedAgent.name;
44265
44581
  } catch {}
44266
44582
  }
44267
- const systemContent = buildSystemContent({ skillContent, categoryPromptAppend });
44583
+ const systemContent = buildSystemContent({ skillContent, categoryPromptAppend, agentName: agentToUse });
44268
44584
  if (runInBackground) {
44269
44585
  try {
44270
44586
  const task = await manager.launch({
@@ -44379,7 +44695,8 @@ To continue this session: session_id="${task.sessionID}"`;
44379
44695
  tools: {
44380
44696
  task: false,
44381
44697
  delegate_task: false,
44382
- call_omo_agent: true
44698
+ call_omo_agent: true,
44699
+ question: false
44383
44700
  },
44384
44701
  parts: [{ type: "text", text: args.prompt }],
44385
44702
  ...categoryModel ? { model: categoryModel } : {}
@@ -44843,7 +45160,8 @@ class BackgroundManager {
44843
45160
  ...getAgentToolRestrictions(input.agent),
44844
45161
  task: false,
44845
45162
  delegate_task: false,
44846
- call_omo_agent: true
45163
+ call_omo_agent: true,
45164
+ question: false
44847
45165
  },
44848
45166
  parts: [{ type: "text", text: input.prompt }]
44849
45167
  }
@@ -45034,7 +45352,8 @@ class BackgroundManager {
45034
45352
  ...getAgentToolRestrictions(existingTask.agent),
45035
45353
  task: false,
45036
45354
  delegate_task: false,
45037
- call_omo_agent: true
45355
+ call_omo_agent: true,
45356
+ question: false
45038
45357
  },
45039
45358
  parts: [{ type: "text", text: input.prompt }]
45040
45359
  }
@@ -50659,7 +50978,15 @@ var AgentOverrideConfigSchema = exports_external.object({
50659
50978
  description: exports_external.string().optional(),
50660
50979
  mode: exports_external.enum(["subagent", "primary", "all"]).optional(),
50661
50980
  color: exports_external.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
50662
- permission: AgentPermissionSchema.optional()
50981
+ permission: AgentPermissionSchema.optional(),
50982
+ maxTokens: exports_external.number().optional(),
50983
+ thinking: exports_external.object({
50984
+ type: exports_external.enum(["enabled", "disabled"]),
50985
+ budgetTokens: exports_external.number().optional()
50986
+ }).optional(),
50987
+ reasoningEffort: exports_external.enum(["low", "medium", "high", "xhigh"]).optional(),
50988
+ textVerbosity: exports_external.enum(["low", "medium", "high"]).optional(),
50989
+ providerOptions: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
50663
50990
  });
50664
50991
  var AgentOverridesSchema = exports_external.object({
50665
50992
  build: AgentOverrideConfigSchema.optional(),
@@ -52986,9 +53313,6 @@ function buildDynamicOrchestratorPrompt(ctx) {
52986
53313
  return ATLAS_SYSTEM_PROMPT.replace("{CATEGORY_SECTION}", categorySection).replace("{AGENT_SECTION}", agentSection).replace("{DECISION_MATRIX}", decisionMatrix).replace("{SKILLS_SECTION}", skillsSection).replace("{{CATEGORY_SKILLS_DELEGATION_GUIDE}}", categorySkillsGuide);
52987
53314
  }
52988
53315
  function createAtlasAgent(ctx) {
52989
- if (!ctx.model) {
52990
- throw new Error("createAtlasAgent requires a model in context");
52991
- }
52992
53316
  const restrictions = createAgentToolRestrictions([
52993
53317
  "task",
52994
53318
  "call_omo_agent"
@@ -52996,7 +53320,7 @@ function createAtlasAgent(ctx) {
52996
53320
  return {
52997
53321
  description: "Orchestrates work via delegate_task() to complete ALL tasks in a todo list until fully done",
52998
53322
  mode: "primary",
52999
- model: ctx.model,
53323
+ ...ctx.model ? { model: ctx.model } : {},
53000
53324
  temperature: 0.1,
53001
53325
  prompt: buildDynamicOrchestratorPrompt(ctx),
53002
53326
  thinking: { type: "enabled", budgetTokens: 32000 },
@@ -53492,9 +53816,6 @@ function mapScopeToLocation(scope) {
53492
53816
  return "plugin";
53493
53817
  }
53494
53818
  async function createBuiltinAgents(disabledAgents = [], agentOverrides = {}, directory, systemDefaultModel, categories, gitMasterConfig, discoveredSkills = [], client2, browserProvider) {
53495
- if (!systemDefaultModel) {
53496
- throw new Error("createBuiltinAgents requires systemDefaultModel");
53497
- }
53498
53819
  const connectedProviders = readConnectedProvidersCache();
53499
53820
  const availableModels = client2 ? await fetchAvailableModels(client2, { connectedProviders: connectedProviders ?? undefined }) : new Set;
53500
53821
  const result = {};
@@ -53527,12 +53848,15 @@ async function createBuiltinAgents(disabledAgents = [], agentOverrides = {}, dir
53527
53848
  continue;
53528
53849
  const override = findCaseInsensitive(agentOverrides, agentName);
53529
53850
  const requirement = AGENT_MODEL_REQUIREMENTS[agentName];
53530
- const { model, variant: resolvedVariant } = resolveModelWithFallback({
53851
+ const resolution = resolveModelWithFallback({
53531
53852
  userModel: override?.model,
53532
53853
  fallbackChain: requirement?.fallbackChain,
53533
53854
  availableModels,
53534
53855
  systemDefaultModel
53535
53856
  });
53857
+ if (!resolution)
53858
+ continue;
53859
+ const { model, variant: resolvedVariant } = resolution;
53536
53860
  let config3 = buildAgent(source, model, mergedCategories, gitMasterConfig, browserProvider);
53537
53861
  if (override?.variant) {
53538
53862
  config3 = { ...config3, variant: override.variant };
@@ -53559,51 +53883,57 @@ async function createBuiltinAgents(disabledAgents = [], agentOverrides = {}, dir
53559
53883
  if (!disabledAgents.includes("sisyphus")) {
53560
53884
  const sisyphusOverride = agentOverrides["sisyphus"];
53561
53885
  const sisyphusRequirement = AGENT_MODEL_REQUIREMENTS["sisyphus"];
53562
- const { model: sisyphusModel, variant: sisyphusResolvedVariant } = resolveModelWithFallback({
53886
+ const sisyphusResolution = resolveModelWithFallback({
53563
53887
  userModel: sisyphusOverride?.model,
53564
53888
  fallbackChain: sisyphusRequirement?.fallbackChain,
53565
53889
  availableModels,
53566
53890
  systemDefaultModel
53567
53891
  });
53568
- let sisyphusConfig = createSisyphusAgent(sisyphusModel, availableAgents, undefined, availableSkills, availableCategories);
53569
- if (sisyphusOverride?.variant) {
53570
- sisyphusConfig = { ...sisyphusConfig, variant: sisyphusOverride.variant };
53571
- } else if (sisyphusResolvedVariant) {
53572
- sisyphusConfig = { ...sisyphusConfig, variant: sisyphusResolvedVariant };
53573
- }
53574
- if (directory && sisyphusConfig.prompt) {
53575
- const envContext = createEnvContext();
53576
- sisyphusConfig = { ...sisyphusConfig, prompt: sisyphusConfig.prompt + envContext };
53577
- }
53578
- if (sisyphusOverride) {
53579
- sisyphusConfig = mergeAgentConfig(sisyphusConfig, sisyphusOverride);
53892
+ if (sisyphusResolution) {
53893
+ const { model: sisyphusModel, variant: sisyphusResolvedVariant } = sisyphusResolution;
53894
+ let sisyphusConfig = createSisyphusAgent(sisyphusModel, availableAgents, undefined, availableSkills, availableCategories);
53895
+ if (sisyphusOverride?.variant) {
53896
+ sisyphusConfig = { ...sisyphusConfig, variant: sisyphusOverride.variant };
53897
+ } else if (sisyphusResolvedVariant) {
53898
+ sisyphusConfig = { ...sisyphusConfig, variant: sisyphusResolvedVariant };
53899
+ }
53900
+ if (directory && sisyphusConfig.prompt) {
53901
+ const envContext = createEnvContext();
53902
+ sisyphusConfig = { ...sisyphusConfig, prompt: sisyphusConfig.prompt + envContext };
53903
+ }
53904
+ if (sisyphusOverride) {
53905
+ sisyphusConfig = mergeAgentConfig(sisyphusConfig, sisyphusOverride);
53906
+ }
53907
+ result["sisyphus"] = sisyphusConfig;
53580
53908
  }
53581
- result["sisyphus"] = sisyphusConfig;
53582
53909
  }
53583
53910
  if (!disabledAgents.includes("atlas")) {
53584
53911
  const orchestratorOverride = agentOverrides["atlas"];
53585
53912
  const atlasRequirement = AGENT_MODEL_REQUIREMENTS["atlas"];
53586
- const { model: atlasModel, variant: atlasResolvedVariant } = resolveModelWithFallback({
53913
+ const atlasResolution = resolveModelWithFallback({
53587
53914
  userModel: orchestratorOverride?.model,
53588
53915
  fallbackChain: atlasRequirement?.fallbackChain,
53589
53916
  availableModels,
53590
53917
  systemDefaultModel
53591
53918
  });
53592
- let orchestratorConfig = createAtlasAgent({
53593
- model: atlasModel,
53594
- availableAgents,
53595
- availableSkills,
53596
- userCategories: categories
53597
- });
53598
- if (orchestratorOverride?.variant) {
53599
- orchestratorConfig = { ...orchestratorConfig, variant: orchestratorOverride.variant };
53600
- } else if (atlasResolvedVariant) {
53601
- orchestratorConfig = { ...orchestratorConfig, variant: atlasResolvedVariant };
53602
- }
53603
- if (orchestratorOverride) {
53604
- orchestratorConfig = mergeAgentConfig(orchestratorConfig, orchestratorOverride);
53919
+ if (atlasResolution) {
53920
+ const { model: atlasModel, variant: atlasResolvedVariant } = atlasResolution;
53921
+ let orchestratorConfig = createAtlasAgent({
53922
+ model: atlasModel,
53923
+ availableAgents,
53924
+ availableSkills,
53925
+ userCategories: categories
53926
+ });
53927
+ if (orchestratorOverride?.variant) {
53928
+ orchestratorConfig = { ...orchestratorConfig, variant: orchestratorOverride.variant };
53929
+ } else if (atlasResolvedVariant) {
53930
+ orchestratorConfig = { ...orchestratorConfig, variant: atlasResolvedVariant };
53931
+ }
53932
+ if (orchestratorOverride) {
53933
+ orchestratorConfig = mergeAgentConfig(orchestratorConfig, orchestratorOverride);
53934
+ }
53935
+ result["atlas"] = orchestratorConfig;
53605
53936
  }
53606
- result["atlas"] = orchestratorConfig;
53607
53937
  }
53608
53938
  return result;
53609
53939
  }
@@ -54293,8 +54623,9 @@ function createBuiltinMcps(disabledMcps = []) {
54293
54623
 
54294
54624
  // src/plugin-handlers/config-handler.ts
54295
54625
  init_shared();
54296
- init_opencode_config_dir();
54297
54626
  init_migration();
54627
+ init_model_resolver();
54628
+ init_model_requirements();
54298
54629
 
54299
54630
  // src/agents/prometheus-prompt.ts
54300
54631
  var PROMETHEUS_SYSTEM_PROMPT = `<system-reminder>
@@ -55513,38 +55844,6 @@ function createConfigHandler(deps) {
55513
55844
  if (pluginComponents.errors.length > 0) {
55514
55845
  log(`Plugin load errors`, { errors: pluginComponents.errors });
55515
55846
  }
55516
- if (!config3.model?.trim()) {
55517
- let fallbackModel;
55518
- for (const agentConfig of Object.values(pluginConfig.agents ?? {})) {
55519
- const model = agentConfig?.model;
55520
- if (model && typeof model === "string" && model.trim()) {
55521
- fallbackModel = model.trim();
55522
- break;
55523
- }
55524
- }
55525
- if (!fallbackModel) {
55526
- for (const categoryConfig of Object.values(pluginConfig.categories ?? {})) {
55527
- const model = categoryConfig?.model;
55528
- if (model && typeof model === "string" && model.trim()) {
55529
- fallbackModel = model.trim();
55530
- break;
55531
- }
55532
- }
55533
- }
55534
- if (fallbackModel) {
55535
- config3.model = fallbackModel;
55536
- log(`No default model specified, using fallback from config: ${fallbackModel}`);
55537
- } else {
55538
- const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
55539
- throw new Error(`oh-my-opencode requires a default model.
55540
-
55541
- ` + `Add this to ${paths.configJsonc}:
55542
-
55543
- ` + ` "model": "anthropic/claude-sonnet-4-5"
55544
-
55545
- ` + "(Replace with your preferred provider/model)");
55546
- }
55547
- }
55548
55847
  const migratedDisabledAgents = (pluginConfig.disabled_agents ?? []).map((agent) => {
55549
55848
  return AGENT_NAME_MAP[agent.toLowerCase()] ?? AGENT_NAME_MAP[agent] ?? agent;
55550
55849
  });
@@ -55602,9 +55901,22 @@ function createConfigHandler(deps) {
55602
55901
  const prometheusOverride = pluginConfig.agents?.["prometheus"];
55603
55902
  const defaultModel = config3.model;
55604
55903
  const categoryConfig = prometheusOverride?.category ? resolveCategoryConfig2(prometheusOverride.category, pluginConfig.categories) : undefined;
55605
- const resolvedModel = prometheusOverride?.model ?? categoryConfig?.model ?? defaultModel;
55904
+ const prometheusRequirement = AGENT_MODEL_REQUIREMENTS["prometheus"];
55905
+ const connectedProviders = readConnectedProvidersCache();
55906
+ const availableModels = ctx.client ? await fetchAvailableModels(ctx.client, { connectedProviders: connectedProviders ?? undefined }) : new Set;
55907
+ const modelResolution = resolveModelWithFallback({
55908
+ userModel: prometheusOverride?.model ?? categoryConfig?.model,
55909
+ fallbackChain: prometheusRequirement?.fallbackChain,
55910
+ availableModels,
55911
+ systemDefaultModel: defaultModel ?? ""
55912
+ });
55913
+ const resolvedModel = modelResolution?.model;
55914
+ const resolvedVariant = modelResolution?.variant;
55915
+ const variantToUse = prometheusOverride?.variant ?? resolvedVariant;
55606
55916
  const prometheusBase = {
55917
+ name: "prometheus",
55607
55918
  ...resolvedModel ? { model: resolvedModel } : {},
55919
+ ...variantToUse ? { variant: variantToUse } : {},
55608
55920
  mode: "primary",
55609
55921
  prompt: PROMETHEUS_SYSTEM_PROMPT,
55610
55922
  permission: PROMETHEUS_PERMISSION,
@@ -55633,7 +55945,7 @@ function createConfigHandler(deps) {
55633
55945
  value ? migrateAgentConfig(value) : value
55634
55946
  ])) : {};
55635
55947
  const migratedBuild = configAgent?.build ? migrateAgentConfig(configAgent.build) : {};
55636
- const planDemoteConfig = replacePlan ? { mode: "subagent" } : undefined;
55948
+ const planDemoteConfig = replacePlan && agentConfig["prometheus"] ? { ...agentConfig["prometheus"], name: "plan", mode: "subagent" } : undefined;
55637
55949
  config3.agent = {
55638
55950
  ...agentConfig,
55639
55951
  ...Object.fromEntries(Object.entries(builtinAgents).filter(([k]) => k !== "sisyphus")),