Skip to main content

render_codex_config

Function render_codex_config 

Source
pub fn render_codex_config(
    compose: &Compose,
    h: AgentHandle<'_>,
    team_mcp_bin: &str,
) -> Option<String>
Expand description

Per-agent Codex config.toml for runtime: codex agents. Returns None for every other runtime. Codex has no --mcp-config flag — MCP servers are read from [mcp_servers.<name>] tables in $CODEX_HOME/config.toml — so this file is the codex-shaped mirror of [render_mcp]’s JSON: the unconditional team bus plus declared mcps: under the same supports_mcp gate (render_mcp already warns when the gate drops them, so this stays quiet). TOML is hand-rendered with proper string escaping — team-core carries no toml crate and one table shape doesn’t earn the dependency.

Two extra seeded tables, both in the exact shape codex 0.144.3 itself persists when a human answers its dialogs (verified live): [projects."<cwd>"] trust_level = "trusted" skips the boot-time trust dialog — whose wording has shifted across codex releases, so pre-seeding beats pane-text matching (the wrapper’s auto-confirm patterns stay as a backstop) — and per-tool [mcp_servers.team.tools.<name>] approval_mode = "approve" entries cover the team bus. Declared mcps: tools are NOT pre-approved (their tool lists are unknown at render time): they prompt once per tool, and an attached operator’s “Always allow” survives only until the next render — documented limitation, follow-up ticket.