Summary
When mcpServers are provided dynamically via ACP session/new or session/load, codex-acp rebuilds each server config and hard-sets:
startup_timeout_sec = None
tool_timeout_sec = None
This makes timeout tuning impossible for dynamically injected MCP servers, even though static TOML-configured servers support these fields.
Why this matters
Some MCP tools legitimately run longer than the default timeout (for example 2–3 minute operations).
With dynamic injection, these calls time out and abort, and there is currently no way to configure timeouts without patching codex-acp.
Repro
- Use an ACP client that injects MCP servers at runtime through
session/new/session/load mcpServers (not static ~/.codex/config.toml).
- Call a tool that runs longer than the default timeout (~2 mins).
- Tool call times out.
- Attempting to configure timeout via injection has no effect because injected config is overwritten to
None.
Current behavior
In src/codex_agent.rs, build_session_config(...) inserts injected servers and explicitly sets:
startup_timeout_sec: None
tool_timeout_sec: None
So runtime-injected servers cannot carry timeout config.
Expected behavior
Runtime-injected MCP servers should be able to configure timeouts (or at least preserve existing configured timeout values), so long-running tools can be supported without local source modifications.
Suggested fix
In build_session_config(...) when mapping ACP McpServer -> McpServerConfig:
- Do not unconditionally set timeout fields to
None.
- Preserve existing timeout values from same-name server if present.
- Optionally parse timeout overrides from
McpServer._meta (e.g. namespaced keys) and apply them.
- Keep current defaults only when no explicit timeout is provided.
Summary
When
mcpServersare provided dynamically via ACPsession/neworsession/load,codex-acprebuilds each server config and hard-sets:startup_timeout_sec = Nonetool_timeout_sec = NoneThis makes timeout tuning impossible for dynamically injected MCP servers, even though static TOML-configured servers support these fields.
Why this matters
Some MCP tools legitimately run longer than the default timeout (for example 2–3 minute operations).
With dynamic injection, these calls time out and abort, and there is currently no way to configure timeouts without patching
codex-acp.Repro
session/new/session/loadmcpServers(not static~/.codex/config.toml).None.Current behavior
In
src/codex_agent.rs,build_session_config(...)inserts injected servers and explicitly sets:startup_timeout_sec: Nonetool_timeout_sec: NoneSo runtime-injected servers cannot carry timeout config.
Expected behavior
Runtime-injected MCP servers should be able to configure timeouts (or at least preserve existing configured timeout values), so long-running tools can be supported without local source modifications.
Suggested fix
In
build_session_config(...)when mapping ACPMcpServer -> McpServerConfig:None.McpServer._meta(e.g. namespaced keys) and apply them.