Prerequisites
Problem Description
search-mode and analyze-mode can instruct the main orchestrator to launch explore and librarian background agents in parallel.
For example, search-mode says:
MAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:
- explore agents (codebase patterns, file structures, ast-grep)
- librarian agents (remote repos, official docs, GitHub examples)
analyze-mode has a similar context-gathering instruction:
CONTEXT GATHERING (parallel):
- 1-2 explore agents (codebase patterns, implementations)
- 1-2 librarian agents (if external library involved)
That is useful when the main orchestrator is doing research directly. However, when the same user request also triggers plan, the parent-level research calls can become redundant.
The plan subagent already receives explicit startup instructions to gather context by calling call_omo_agent for explore and librarian.
The plan-agent prepend currently includes a mandatory context-gathering protocol equivalent to:
Launch background agents to gather context:
- call_omo_agent(..., subagent_type="explore", run_in_background=true, ...)
- call_omo_agent(..., subagent_type="librarian", run_in_background=true, ...)
So a single main-session request can produce a mixed wave like:
main Sisyphus
-> task(subagent_type="explore", run_in_background=true)
-> task(subagent_type="librarian", run_in_background=true)
-> task(subagent_type="plan", run_in_background=false)
Then the plan session may start and perform its own context gathering:
plan
-> call_omo_agent(subagent_type="explore", run_in_background=true)
-> call_omo_agent(subagent_type="librarian", run_in_background=true)
This is related to #2124, but the request here is not just to improve prompt-following. It is to add a runtime guardrail that prevents redundant parent-level research subagents from being launched alongside plan.
Proposed Solution
Add a runtime guardrail for main-session subagent delegation when plan is part of the same delegation wave.
Recommended behavior:
If the main session attempts to launch `plan` together with `explore` or `librarian`,
fail the main-session `explore` / `librarian` launches and allow `plan` to run.
The rationale is that plan already has explicit instructions to call call_omo_agent for explore and librarian when it needs context. Letting the main session launch those same research agents in parallel can duplicate the same work.
Suggested blocking message:
Blocked: `explore` / `librarian` should not be launched in parallel with `plan` from the main session.
The `plan` subagent already gathers context via `call_omo_agent`; let `plan` run first and use its own context-gathering path.
The guard should be scoped narrowly:
- Apply only to main-session launches.
- Apply when
plan is being launched in the same parent delegation wave.
- Prefer failing
explore / librarian launched alongside plan, not failing plan.
- Do not block
plan from calling call_omo_agent internally.
- Do not block normal
explore / librarian usage when plan is not part of the same wave.
Alternatives Considered
- Strengthen prompts only
This was effectively the situation in #2124. It depends on model compliance and can regress across models or prompt combinations.
- Fail
plan when research subagents are already active
This avoids duplication, but it pushes the agent back toward the same prompt-following problem. Since plan has its own context-gathering instructions, allowing plan and failing the redundant main-session research calls seems more deterministic.
- Disable plan's own context gathering
This targets a different layer. The plan prompt explicitly tells plan to gather context via call_omo_agent, so the cleaner guardrail is to avoid launching duplicate research subagents from the parent main session.
- Block
explore / librarian globally from main sessions
Too broad. explore and librarian are useful when plan is not involved. The issue is only the mixed wave with plan.
Doctor Output (Optional)
Not available. This feature request is based on source inspection and prior issue #2124.
Additional Context
Related issue:
Relevant source paths:
packages/prompts-core/prompts/mode/search.md
packages/prompts-core/prompts/mode/analyze.md
src/tools/delegate-task/constants.ts
src/agents/dynamic-agent-core-sections.ts
Feature Type
New Hook
Contribution
Prerequisites
Problem Description
search-modeandanalyze-modecan instruct the main orchestrator to launchexploreandlibrarianbackground agents in parallel.For example,
search-modesays:analyze-modehas a similar context-gathering instruction:That is useful when the main orchestrator is doing research directly. However, when the same user request also triggers
plan, the parent-level research calls can become redundant.The
plansubagent already receives explicit startup instructions to gather context by callingcall_omo_agentforexploreandlibrarian.The plan-agent prepend currently includes a mandatory context-gathering protocol equivalent to:
So a single main-session request can produce a mixed wave like:
Then the
plansession may start and perform its own context gathering:This is related to #2124, but the request here is not just to improve prompt-following. It is to add a runtime guardrail that prevents redundant parent-level research subagents from being launched alongside
plan.Proposed Solution
Add a runtime guardrail for main-session subagent delegation when
planis part of the same delegation wave.Recommended behavior:
The rationale is that
planalready has explicit instructions to callcall_omo_agentforexploreandlibrarianwhen it needs context. Letting the main session launch those same research agents in parallel can duplicate the same work.Suggested blocking message:
The guard should be scoped narrowly:
planis being launched in the same parent delegation wave.explore/librarianlaunched alongsideplan, not failingplan.planfrom callingcall_omo_agentinternally.explore/librarianusage whenplanis not part of the same wave.Alternatives Considered
This was effectively the situation in #2124. It depends on model compliance and can regress across models or prompt combinations.
planwhen research subagents are already activeThis avoids duplication, but it pushes the agent back toward the same prompt-following problem. Since
planhas its own context-gathering instructions, allowingplanand failing the redundant main-session research calls seems more deterministic.This targets a different layer. The plan prompt explicitly tells
planto gather context viacall_omo_agent, so the cleaner guardrail is to avoid launching duplicate research subagents from the parent main session.explore/librarianglobally from main sessionsToo broad.
exploreandlibrarianare useful whenplanis not involved. The issue is only the mixed wave withplan.Doctor Output (Optional)
Additional Context
Related issue:
Plan agent not wait Explore agentRelevant source paths:
packages/prompts-core/prompts/mode/search.mdpackages/prompts-core/prompts/mode/analyze.mdsrc/tools/delegate-task/constants.tssrc/agents/dynamic-agent-core-sections.tsFeature Type
New Hook
Contribution