Make wait_agent default timeout configurable

Open 💬 1 comment Opened Apr 17, 2026 by chigkim

What variant of Codex are you using?

cli

What feature would you like to see?

wait_agent currently seems to default to a hardcoded 30 second timeout when timeout_ms is omitted. I’d like a config option to change that default without patching Codex source.

When a spawned agent is still running and the parent calls wait_agent without timeout_ms, the wait expires after 30 seconds. The model then often responds with something like:

"The agent timed out. Let me wait again with more time or check its status."

In practice this is usually not the subagent dying; it is the parent’s wait_agent call timing out.
For long-running subagent tasks, 30 seconds is too short as a default. This causes unnecessary polling loops, noisy model messages, and avoidable extra turns/tool calls.

I can configure things like:

  • stream_idle_timeout_ms
  • agents.job_max_runtime_seconds

but those do not control the default timeout for normal wait_agent calls.

Please add a config option for the default wait_agent timeout, for example:

[agents]
wait_timeout_ms = 300000

It may also be useful to make the min/max clamp configurable, or at least keep max at 1 hour but let users raise the default.

Additional information

The default appears to be hardcoded here?

  • codex-rs/core/src/tools/handlers/multi_agents_common.rs
  • DEFAULT_WAIT_TIMEOUT_MS: i64 = 30_000;
  • codex-rs/core/src/tools/handlers/multi_agents/wait.rs
  • args.timeout_ms.unwrap_or(DEFAULT_WAIT_TIMEOUT_MS)
  • codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs
  • args.timeout_ms.unwrap_or(DEFAULT_WAIT_TIMEOUT_MS)
  • codex-rs/core/src/tools/spec.rs
  • passes default_timeout_ms: DEFAULT_WAIT_TIMEOUT_MS into the tool spec

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗