Repository navigation
Description
What version of Codex are you using?
- Codex App: 26.707.72221 (build 5307, bundle
com.openai.codex) - Codex CLI: 0.144.4
What subscription do you have?
ChatGPT-authenticated local Codex session.
What platform is your computer?
macOS 26.5.2 (25F84), arm64
What issue are you seeing?
Configured custom agents cannot be selected by their exact name because the model-visible spawn_agent interface exposes only a task/thread label (task_name) and a prompt, not a registered custom-agent selector such as agent_name, agent_type, or role.
A valid custom agent exists under ~/.codex/agents/ with the required fields documented at https://developers.openai.com/codex/multi-agent:
name = "luna_file_scout"
description = "Read-only targeted discovery."
model = "gpt-5.6-luna"
model_reasoning_effort = "low"
sandbox_mode = "read-only"
developer_instructions = "Perform only bounded read-only discovery."The documentation says that the name field is the source of truth and that Codex identifies and spawns the custom agent by that name. However, the available runtime tool schema does not provide a field that can carry that name. Passing the value as task_name would only label the task and would not prove that the TOML configuration was applied.
This also prevents selecting built-in agent types such as explorer through the same interface, so the problem appears to be the exposed spawn contract rather than the custom TOML file itself.
What steps can reproduce the bug?
-
Create
~/.codex/agents/luna_file_scout.tomlusing the valid schema shown above. -
Confirm
multi_agentis enabled. Leavemulti_agent_v2anduse_agent_identitydisabled. -
Restart Codex and start a new session.
-
Ask Codex to use the configured custom agent by exact name:
Use the configured custom agent whose exact name is luna_file_scout. Delegate a small read-only lookup. Do not substitute a generic or built-in agent. -
Inspect the model-visible spawn interface and subagent activity.
-
As a control, ask Codex to use the built-in
exploreragent for the same read-only lookup.
A/B result
Case A: configured custom agent
- Requested agent:
luna_file_scout - Result: not dispatched
- Evidence: the runtime schema exposed no configured-agent selector;
task_namewas correctly rejected as proof of custom-agent selection - Fallback agent: none
Case B: built-in control
- Requested agent:
explorer - Result: not dispatched
- Evidence: the runtime again exposed only
task_name, with no built-in agent-type selector - Fallback agent: none
What is the expected behavior?
The spawn interface should expose a registered agent selector whose accepted values include built-in and loaded custom-agent names. When luna_file_scout is selected, the activity metadata should identify the underlying configured agent type as luna_file_scout, and the child should receive its configured model, reasoning effort, instructions, and sandbox settings subject to documented parent runtime overrides.
What is the actual behavior?
Only a task/thread label and prompt are available. The runtime cannot select or verify either luna_file_scout or the built-in explorer agent, so compliant orchestration must refuse to dispatch rather than silently substitute a generic agent.
Feature state
multi_agent: stable, enabledmulti_agent_v2: under development, disableduse_agent_identity: under development, disabled
No under-development feature was enabled for this reproduction.
Additional information
Restarting the App and creating a fresh session did not change the exposed spawn interface. The custom-agent TOML is present at the documented location and contains the documented required fields.
Activity
github-actions commentedon Jul 15, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Loong0x00 commentedon Jul 20, 2026
Confirmed on Linux x86_64 with
codex-cli 0.144.6(ChatGPT auth). At the time of testing, both npm and GitHub Releases report0.144.6as the latest stable version.This still reproduces in both interactive TUI and
codex exec, and it is not limited to project config discovery:.codex/config.toml+.codex/agents/implementer.toml;~/.codex/config.toml+~/.codex/agents/implementer.toml;codex --strict-config --versionsucceeds;collaboration.spawn_agentschema still exposes onlytask_name,message, andfork_turns.The registered profile intentionally had distinctive values:
I forced an exact call with
task_name = "implementer"andfork_turns = "none". The child completed successfully, but persisted rollout metadata showed:The distinctive developer-instruction text was also absent from the child rollout. In other words,
task_nameonly named the thread; it did not resolve the configured profile. The child silently inherited the parent configuration instead of using Terra/high.This silent fallback is especially frustrating because the spawn and delegated task both report success. Without inspecting rollout internals, the user is led to believe the requested role, model, instructions, and safety policy were applied when they were not.
The spawn contract needs separate structured inputs, for example:
{ "agent_type": "implementer", "task_name": "implement_slice_p0", "message": "...", "fork_turns": "none", "model": "gpt-5.6-terra", "reasoning_effort": "high" }agent_type/roleshould resolve the complete registered profile;task_nameshould remain only the task/thread label. An unknown or unavailable role should fail explicitly instead of spawning a generic child withagent_role = null.This also overlaps #33881. #31814 was closed after a maintainer said model/effort controls and role capabilities would return in the next release, but the latest stable
0.144.6still has the restricted schema and the same silent inheritance. If the fix is currently alpha-only, please document the target stable version and keep a stable-release tracking issue open until the exact model-visible spawn contract is verified end to end.geoff-ux commentedon Aug 18, 2026
We have a production headless-certification use case that is blocked on this exact boundary.
A fresh, read-only Linux sandbox contains a trusted repository checkout and a project-scoped custom agent at
.codex/agents/flowos_qa.toml. The host needs to invoke that registered agent by exact identity fromcodex exec, provide a four-field exact-revision handoff, and receive a structured terminal verdict. Silent substitution with a generic child is unacceptable because the custom agent owns the non-authoring permissions, model/reasoning route, and certification instructions.Observed with
codex-cli 0.146.0, stablemulti_agentenabled:codex execprompt explicitly requested the registeredflowos_qaagent;Not dispatched. Admission verdict unavailable.The first-class shape could be either an explicit headless selector such as
codex exec --agent flowos_qa, or a structuredagent_type/role field that resolves the registered profile. For unattended certification we also need:This currently prevents us from using Codex as an independent repository-owned certifier in a cloud agent loop. We are using a separate cross-vendor certifier temporarily rather than parsing the TOML or copying the agent instructions. Happy to provide a smaller sanitized reproduction if useful.
namonamo7-max commentedon Sep 30, 2026
Resolved locally on 2026-09-30 (ChatGPT/Codex app 26.924.22138; bundled codex-cli 0.158.0-alpha.2.1). This was a configuration-validation failure, not a valid reproduction of the issue with loaded roles.
Root cause: all ten local role declarations used bilingual
nickname_candidatescontaining non-ASCII characters and/. The installed CLI's role loader rejects those candidates. Before correction,codex doctorreported ten malformed-role warnings and the desktopspawn_agentschema omittedagent_type. The current source makes this causal chain explicit: nickname validation incodex-rs/agent-roles/src/agent_role_config.rs, malformed-role skipping incodex-rs/agent-roles/src/loader.rs, andexpose_agent_type: !agent_roles.is_empty()incodex-rs/core/src/tools/spec_plan.rs.After changing the ten nickname candidates to ASCII-only canonical names and placing each role's developer instructions in a referenced role config file,
codex doctorreported zero malformed-role warnings. In a fresh desktop task,agent_typeappeared and all ten configured roles were listed. Two typed, isolated read-only probes then recordedagent_role: martaandagent_role: iris, respectively, with task names different from the role IDs. Both children reported receiving their role-specific developer instructions. No existing work task was touched or app restart performed.Please disregard my original upstream-regression attribution. The current implementation successfully exposed and applied typed roles once the local role definitions passed validation. A useful product improvement would be clearer diagnostics when every configured role is rejected, since the hidden
agent_typefield otherwise looks like a schema regression.NOTHING0313 commentedon Oct 5, 2026
I'm seeing a similar symptom on a newer Windows Codex App / CLI version, so I'm adding my environment as another data point.
Environment
26.930.31730129470.160.026200collaborationI have three custom agent files under:
C:\Users\pascalzhao\.codex\agents\implementation_worker.tomlindependent_tester.tomlindependent_qa.tomlFor each file I verified that:
name,description, anddeveloper_instructionsare non-empty;name.In my current session, the exposed
collaboration.spawn_agentschema contains:agent_typemodelreasoning_efforttask_namemessagefork_turnsSo at the moment I don't have an exposed field that lets me explicitly select one of those configured roles.
I also tried one process-only diagnostic with a temporary
-cconfiguration override usingcodex debug prompt-input, but it exited with code1andos error 5(Access denied). I haven't identified which operation caused that error, so I don't know whether it is related to role loading.No persistent
config.tomlchanges were made.I noticed the comment above where missing
agent_typewas caused by malformednickname_candidates. My three current role files pass the basic TOML/required-field checks described above, but I have not yet confirmed whether there is another loader-level validation issue in my setup.Is
agent_typeexpected to be exposed bycollaboration.spawn_agentin Codex App26.930.31730/ CLI0.160.0when custom roles are loaded successfully?If there is a recommended diagnostic for confirming whether the runtime actually loaded the files under
~/.codex/agents/, I'd be happy to run it and provide the result.