spawn_agent forces approval_policy=never; breaks collab thread navigation and blocks sandbox escalation
Problem
spawn_agent (thread-spawned subagents used by Collab / multi-agent TUI) currently clamps the spawned thread's approval_policy to never.
This causes two practical breakages:
1) Config mismatch errors when navigating/resuming subagent threads (e.g. in the TUI /agents view) if the parent session is started with -a on-request (or any non-never policy). The error looks like:
OnRequest is not in the allowed set [Never]
2) Spawned agents can't request sandbox escalation approvals (e.g. running Playwright on macOS in workspace-write sandbox often requires escalation to launch Chromium/WebKit/Firefox). With approval_policy=never, the agent can never ask, which forces users to switch to danger-full-access as a workaround.
Root cause
In codex-rs/core/src/tools/handlers/multi_agents.rs, apply_spawn_agent_overrides does:
config.permissions.approval_policy = Constrained::allow_only(AskForApproval::Never);
So the spawned thread is permanently constrained to never even when the parent session is interactive and explicitly configured to use on-request.
Expected
Spawned threads should inherit the parent session's effective approval policy (and constraints) by default.
Non-interactive exec already uses approval_policy=never, so inheriting it keeps the current behavior for headless runs.
Actual
Spawned threads are forced to never, producing the mismatch error above and preventing escalation approvals.
Environment / repro
- Codex CLI:
0.101.0+(observed in0.104.0andmain) - macOS (arm64)
- Start Codex TUI with
--full-auto(or-a on-request), spawn an agent, then navigate to the spawned thread via/agents.
Proposed fix
Remove the hard override and let the spawned thread inherit the parent approval policy.
(Background subagents created by other systems can continue to clamp approval_policy=never if needed.)
5 Comments
Thanks — sharing a ready-to-cherry-pick patch for this issue.
PR #12714 was automatically closed because contributions are invitation-only, but the minimal fix is implemented here:
Patch summary:
approval_policy=neverinapply_spawn_agent_overrides(multi_agents handler)Minimal diff:
Why this matters in practice:
-a on-requesthitOnRequest is not in the allowed set [Never]when navigating/resuming spawned agent threadsworkspace-writesandbox, Playwright/Chromium frequently requires sandbox escalation; withapproval_policy=never, spawned agents can never request it, forcingdanger-full-accessas a workaroundIf you want to keep the current default for safety, a follow-up alternative is to make this behavior configurable (default: clamp, opt-in: inherit), but the above commit is the smallest behaviorally-correct fix for interactive Collab.
This will be removed once the UX is good enough such the approval requests are correctly piped to you. In the meantime we keep it like this on purpose
Thanks for confirming this is intentional for now.
Even if spawned threads are clamped to
approval_policy=never, the current UX is rough for interactive Collab sessions started with-a on-request:1) Switching to a spawned agent thread from the TUI (
/agents) and sending a message often triggersOnRequest is not in the allowed set [Never]. Sometimes the thread becomes “stuck” at the final message / you can’t continue the conversation.2) This is especially painful on macOS
workspace-writewhere Playwright/Chromium frequently needs sandbox escalation; withneverthe subagent can’t request it, pushing users todanger-full-access.Suggested improvements (keeping the safety clamp):
send_input./agents, show each agent thread’s effectiveapproval_policy(and maybesandbox_mode) so the user understands why approvals won’t happen.danger-full-access.Happy to provide a minimal repro script / rollouts if useful.
One more clarifying point on severity: in the current TUI Collab flow this is not just a warning—after switching to a spawned agent via /agents, attempting to send any message can fail immediately with the allowed-set mismatch (send_input errored / UI rejects the turn). In other words: sometimes you can’t even ask the subagent a question, making Collab effectively unusable in interactive (-a on-request) sessions.
Workaround we found (Codex CLI 0.106.0, interactive Collab TUI):
-a never(or re-attach/resume the manager SID with-a neverbefore spawning / switching to agents).never,/agentsnavigation + sending messages to spawned agents works reliably (noOnRequest is not in the allowed set [Never]/ no immediatesend_inputfailure), because the whole tree shares allowed-set[Never].Tradeoff: no interactive approvals anywhere, so for things like Playwright on macOS
workspace-writeyou need to pre-allow the required command prefixes via rules/allowlists (or use a higher permission preset).