codex - 💡(How to fix) Fix Make wait_agent default timeout configurable [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18394Fetched 2026-04-18 05:54:58
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4unlabeled ×1

Fix Action

Fix / Workaround

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.

Code Example

[agents]
wait_timeout_ms = 300000
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Add a configuration option to change the default wait_agent timeout, currently hardcoded to 30 seconds, to a user-defined value.

Guidance

  • Review the proposed configuration option in the issue, such as [agents] wait_timeout_ms = 300000 in a TOML file, to understand how the default timeout could be modified.
  • Investigate the referenced code files (multi_agents_common.rs, wait.rs, multi_agents_v2/wait.rs, and spec.rs) to confirm the hardcoded default and how it is used.
  • Consider the potential benefits of making the minimum and maximum timeout values configurable, as mentioned in the issue.
  • Evaluate the impact of increasing the default timeout on the overall system behavior, including potential effects on polling loops, model messages, and tool calls.

Example

[agents]
wait_timeout_ms = 300000

This example shows how the proposed configuration option could be used to set the default wait_agent timeout to 5 minutes (300,000 milliseconds).

Notes

The issue provides specific code references and a clear proposal for a configuration option, making it easier to understand the requested change. However, the implementation details and potential side effects of modifying the default timeout are not fully explored in the issue.

Recommendation

Apply workaround: Modify the configuration to use a custom default timeout value, as proposed in the issue, to address the immediate need for a longer default timeout.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING