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.)
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗