Skip to content

Skill instructions to use subagents are ignored unless repeated in the prompt #23496

Open

Description

@dcominottim

What version of Codex CLI is running?

codex-cli 0.130.0

Installed via Homebrew cask on this machine. Homebrew currently still serves 0.130.0 even though 0.131.0 is the latest upstream release.

What subscription do you have?

N/A / not subscription-specific.

Which model were you using?

Default Codex CLI model for the session. This does not appear to be model-specific.

What platform is your computer?

Linux 7.0.4-200.fc44.x86_64 x86_64 unknown

What terminal emulator and version are you using (if applicable)?

Linux terminal session. TERM=xterm-256color, COLORTERM=truecolor; no tmux/zellij detected.

The observed session was running Codex in YOLO mode / bypass-approval mode:

codex --dangerously-bypass-approvals-and-sandbox

Codex doctor report

{
  "status": "not_available",
  "reason": "The installed Codex CLI version does not support `codex doctor --json`; it exits with `error: unexpected argument '--json' found`. Running `codex doctor` in this non-interactive session exits with `Error: stdin is not a terminal`."
}

What issue are you seeing?

Codex CLI does not reliably use subagents when the instruction to use them comes from a loaded skill, even when YOLO mode is enabled. It only uses subagents when the user prompt also explicitly says to use subagents.

That means these two cases behave differently:

  1. Skill instructions say to use subagents, user asks for the skill-matching task, YOLO mode is enabled: Codex proceeds locally without spawning subagents.
  2. Same skill and same task, but the user also says something like "use subagents" in the prompt: Codex spawns subagents.

The second prompt-level instruction is redundant with the skill. If a skill is selected and its SKILL.md or supporting workflow instructions explicitly require subagents, the CLI should treat that as sufficient authorization/instruction to spawn them, especially when approval bypass / YOLO mode is already on.

What steps can reproduce the bug?

  1. Create or install a Codex skill whose instructions explicitly require subagents for a workflow. For example, a review skill that says to split independent surfaces across subagents and merge the findings.
  2. Start Codex CLI with YOLO/bypass mode enabled:
codex --dangerously-bypass-approvals-and-sandbox
  1. Ask for a task that clearly triggers the skill, but do not repeat "use subagents" in the prompt.
  2. Observe that Codex performs the work in the main agent and does not call spawn_agent.
  3. Repeat the same task, with the same skill available, but add explicit prompt text such as "use subagents".
  4. Observe that Codex now spawns subagents.

A concrete pattern that exposes the issue is a documentation or code review workflow where the skill already says to use subagents across independent review surfaces. Without the redundant prompt text, the intended subagent workflow is skipped.

What is the expected behavior?

When a selected skill explicitly instructs Codex to use subagents, Codex CLI should honor that instruction without requiring the user to repeat it in the prompt.

If the product intentionally requires prompt-level authorization for subagent spawning regardless of skill instructions, the CLI should make that explicit and warn when a skill requests subagents but the prompt did not separately authorize them. Otherwise skill-authored workflows are brittle: the same task can silently run with a different execution strategy depending on whether the user happens to duplicate the skill instruction in natural language.

Additional information

I searched open issues for subagents + skills + YOLO mode before filing and did not find an obvious duplicate.

This is not asking Codex to spawn subagents for every task. The problem is narrower: when a loaded skill itself requires subagents, that instruction should be honored the same way as other skill instructions, or the CLI should surface why it is being ignored.

Activity

  1. added
    bug
    CLI
    skills
    subagent
    on May 19, 2026
  2. github-actions commented on May 19, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. dcominottim commented on May 19, 2026

    @dcominottim
    Author

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

    This issue is not a duplicate.

  4. alexeyv commented on Jun 4, 2026

    @alexeyv

    Additional reproduction nuance:

    This appears to be an instruction-conflict problem, not only a skill-loading problem.

    The current spawn_agent tool description says:

    Only use spawn_agent if and only if the user explicitly asks for sub-agents, delegation, or parallel agent work.
    Requests for depth, thoroughness, research, investigation, or detailed codebase analysis do not count as permission to spawn.

    When a skill workflow requires subagents, the model has to reconcile two instructions:

    1. The active skill says to use subagents for a workflow step.
    2. The tool says subagents require explicit user request.

    In testing, Codex behavior was unstable:

    • In one run, Codex used a subagent without first asking.
    • Immediately afterward, when asked, it acknowledged that the tool instruction required it to pause and ask for authorization.
    • In another old-skill run, Codex instead treated the permission problem like "subagents unavailable" and followed a non-subagent fallback.

    That distinction matters: "subagent capability unavailable" is not the same as "subagent capability exists but needs prompt-level authorization."

    Expected behavior should be deterministic. Either:

    • Skill workflow instructions count as explicit authorization to use subagents/tasks, or
    • Codex must pause and ask once when an active skill requires subagents but prompt-level authorization is missing.

    What should not happen is the current ambiguous behavior where the model may spawn, ask, or silently degrade to a fallback depending on how it resolves the instruction conflict.

  5. alexeyv commented on Jun 4, 2026

    @alexeyv

    Suggested policy shape:

    Treat selected skill/workflow instructions that explicitly call for bounded sub-agent use as a valid spawn trigger, the same way an explicit user prompt is currently treated.

    A good guardrail would be:

    • prompt-level subagent request → spawn as today
    • selected skill/workflow explicitly requires or recommends subagents → allow spawn at the relevant workflow step
    • selected skill/workflow says to ask first → ask once at activation or before the first spawn
    • no prompt or selected-skill trigger → keep the current conservative behavior

    The important part is that "subagents are unavailable" and "subagents are available but require prompt-level authorization" should not collapse into the same fallback path. Codex should either honor the selected skill's subagent instruction or surface the missing authorization deterministically.

  6. dpearson2699 commented on Jun 10, 2026

    @dpearson2699

    Adding a current Codex Desktop/tool-backed reproduction from a skill-governed PR-review workflow.

    Feedback/session reference:

    • Feedback ID: 019eafa5-64f3-70c0-81f3-521257bacd1a

    Environment/context:

    • Date observed: 2026-06-10
    • Surface: Codex Desktop / tool-backed session
    • Tool exposed: multi_agent_v1.spawn_agent
    • Active skill/workflow: repo-local PR-review workflow
    • The workflow explicitly declares that its normal and goal-wrapped invocations authorize the required internal subagent workflow, including a remote-blind local review subagent.

    Concrete repro:

    1. A goal-wrapped PR-review task was active for a merge-conflict review.
    2. The selected PR-review skill states that this invocation is task-scoped delegation authorization and requires a remote-blind local review subagent.
    3. Codex loaded the skill and reached the local-review gate.
    4. The exposed spawn_agent tool metadata said: Only use spawn_agent if and only if the user explicitly asks for sub-agents, delegation, or parallel agent work.
    5. Codex treated that tool-level instruction as overriding the selected skill’s delegation authority, classified delegation as unavailable/limited, and performed the local review in the parent agent instead of spawning the required blind review subagent.

    Why this is still a bug even after improving the skill text:

    • The skill can say very explicitly that the workflow invocation authorizes subagents.
    • The runtime/tool policy still requires the live user prompt to separately include words like “use subagents” or “delegate.”
    • That makes skill-authored orchestration brittle: the same selected workflow has different execution semantics depending on whether the user duplicates the skill’s subagent instruction in the active prompt.

    Expected behavior:

    • A selected skill/workflow that explicitly requires bounded subagent use should count as sufficient scoped authorization for that workflow step, or
    • Codex should stop and ask once for authorization instead of silently degrading to a parent-thread fallback, and
    • The UI/logs should distinguish “subagents unavailable” from “subagents available but prompt-level authorization missing.”

    This is especially important for review workflows where independence is part of the correctness property. A parent-agent local review is not equivalent to a remote-blind local review subagent.

  7. samxu01 commented on Jun 24, 2026

    @samxu01

    This — "instructions to use subagents ignored unless repeated" — is the runtime layer leaking into agent config. We took the inverse: dispatch is a kernel-level event (mention/event), so the runtime stays dumb and it isn't a prompt instruction that can be silently dropped. Would your case behave better if the dispatch weren't in the prompt at all? Happy to show what we do — we open-sourced it (Commonly — github.com/Team-Commonly/commonly).

  8. jeonsavvy commented on Jul 26, 2026

    @jeonsavvy

    Adding a possibly related current project-instruction reproduction. I did not separately test selected SKILL.md loading in these runs.

    Environment:

    • Observed: 2026-07-26
    • Windows, Codex CLI 0.146.0-alpha.3.1
    • Canary invocation: gpt-5.6-sol / ultra
    • Isolated fresh codex exec sessions

    The synthetic repository's project instructions required automatic bounded delegation when independent, disjoint work axes existed. The live task prompt intentionally did not mention subagents. The repository had five independent modules with disjoint files and deterministic tests.

    Across two distinct fresh sessions:

    • the turn completed and the parent changed all five modules
    • the final test suite exited 0
    • spawn_agent events: 0
    • sub_agent_activity events: 0
    • the only collaboration-tool events were empty wait calls (1 call in one run, 4 in the other; no receiver threads or agent state)

    A separate unknown-root-cause scenario also reached its first file change without spawning the required read-only Explorer.

    Expected:

    • Project or selected-skill instructions that explicitly require bounded subagent use should be sufficient to trigger the relevant spawn without repeating the same bounded-delegation instruction in every live task prompt, or the runtime should surface an explicit blocked reason.
    • It is not necessary to spawn one child per axis, but at least one child should be observable when capacity is available and a hard trigger is satisfied.

    This is a project-instruction reproduction that may share the same instruction-precedence or triggering failure; it does not prove the selected-skill path or a specific root cause. Child model/effort routing was not exercised because no child was created.

    I can prepare a focused regression fixture or patch if maintainers confirm the intended semantics and invite a contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugskillssubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions