Skip to content

Custom .codex/agents no longer selectable in CLI v0.137.0; subagents spawn generic and inherit parent model #26363

@mtsitzer

Description

@mtsitzer

What version of Codex CLI is running?

0.137.0

What subscription do you have?

Pro Lite

Which model were you using?

gpt-5.5

What platform is your computer?

Linux (WSL2)

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

VSCode

What issue are you seeing?

Summary

In Codex CLI v0.137.0, project-scoped custom subagents under .codex/agents/*.toml are no longer selectable from the model-visible spawn_agent tool surface. Spawned subagents fall back to generic multi_agent_v1 threads, inherit the parent model/reasoning settings, and do not record agent_role or agent_path in session metadata.

This is a regression from earlier CLI versions where spawn_agent accepted an agent_type argument and correctly spawned the configured custom agent.

Environment

  • Codex CLI version: 0.137.0
  • Platform: Linux
  • Auth mode: ChatGPT
  • Parent model: gpt-5.5
  • Custom agents are defined under project scope:
    • .codex/agents/researcher.toml

Custom agent shape

Example custom agent file:

name = "researcher"
description = "Read-only source researcher."
model = "gpt-5.4-mini"
model_reasoning_effort = "medium"
sandbox_mode = "read-only"
nickname_candidates = ["Researcher", "Source Researcher"]

developer_instructions = """
You are a read-only researcher. Do not edit files. Return concise findings.
"""

Expected behavior

When asking Codex to spawn the custom researcher agent, the spawned thread should:

  • Load .codex/agents/researcher.toml
  • Use model = "gpt-5.4-mini"
  • Use model_reasoning_effort = "medium"
  • Record agent_role = "researcher" or equivalent custom-agent identity in session metadata
  • Record an agent_path or otherwise show that the custom agent config was loaded

This worked in an earlier Codex CLI version. In that version, the model-visible spawn call accepted an argument like:

{
"agent_type": "researcher",
"message": "...",
"fork_context": false
}

Actual behavior in v0.137.0

The exposed tool is multi_agent_v1.spawn_agent, and its schema only accepts:

fork_context
items
message

There is no agent_type, agent, name, model, or custom-agent selector field.

When a subagent is spawned with prompt text like “You are acting as researcher,” the spawned session is generic:

source=subagent:thread_spawn
agent_role=None
agent_path=None
model=gpt-5.5
effort=high
multi_agent_version=v1

So the child thread inherits the parent gpt-5.5/high configuration instead of using the custom agent’s pinned gpt-5.4-mini/medium.

What steps can reproduce the bug?

Reproduction Steps

  1. Create a project-scoped custom agent:

.codex/agents/researcher.toml

with:

  name = "researcher"
  description = "Read-only researcher."
  model = "gpt-5.4-mini"
  model_reasoning_effort = "medium"
  sandbox_mode = "read-only"
  developer_instructions = "You are a read-only researcher."
  1. Start Codex CLI v0.137.0 in that project.
  2. Ask Codex to spawn the custom researcher agent.
  3. Inspect the available spawn_agent tool schema and the resulting child session metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehaviors that worked in previous versions but were broken due to an updatesubagentIssues involving subagents or multi-agent features

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions