You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make wait_agent default timeout configurable #18394
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.
The current source at ddf04ad26789d040f9ef6a96736f76602e35a6cc exposes v2 timeout configuration under [features.multi_agent_v2] (min_wait_timeout_ms, default_wait_timeout_ms, max_wait_timeout_ms). However, a larger default alone does not stop a model explicitly requesting 60-second waits under its developer instructions. Measured reproduction, mitigation, and requested runtime fixes: #35108 (comment). Repeated parent-model continuations cause excessive token consumption even when the child is healthy and nothing has changed. Please address the instruction conflict and runtime resampling alongside configurable deadlines; changing the default by itself leaves this failure mode intact.
Activity
je2ryw commentedon Apr 27, 2026
having the same issue with
wait_agenttimeout after 30 seconds, and in most of case, the main agent will only retry 2-3 times then give up.czwaxm commentedon Jul 24, 2026
这是一个很严重的问题,它导致大量的token 消耗
rezzminator commentedon Sep 5, 2026
The current source at
ddf04ad26789d040f9ef6a96736f76602e35a6ccexposes v2 timeout configuration under[features.multi_agent_v2](min_wait_timeout_ms,default_wait_timeout_ms,max_wait_timeout_ms). However, a larger default alone does not stop a model explicitly requesting 60-second waits under its developer instructions. Measured reproduction, mitigation, and requested runtime fixes: #35108 (comment). Repeated parent-model continuations cause excessive token consumption even when the child is healthy and nothing has changed. Please address the instruction conflict and runtime resampling alongside configurable deadlines; changing the default by itself leaves this failure mode intact.