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
The main agent does not handle subagents reliably.
When a subagent task takes a little longer, the main agent often stops or closes the subagent prematurely and continues the task on its own, instead of waiting for the subagent to finish.
When explicitly instructed to wait for the subagent's response and only close it when appropriate, for example, when the task is completed or an error occurs, the opposite problem happens: the main agent starts polling the subagent repeatedly at very short intervals.
While waiting, it also tends to perform unnecessary actions instead of remaining idle. It seems unable to simply wait for the subagent when no other work is required.
What steps can reproduce the bug?
Start a new thread;
Ask main agent to spawn a subagent to proceed with some task.
What is the expected behavior?
The main agent should manage subagents according to their actual state:
If a subagent is still working, the main agent should not terminate or close it prematurely.
If there is nothing useful to do while waiting, the main agent should become idle instead of repeatedly polling or performing unnecessary work.
The main agent should resume execution when it receives a completion/error signal from the subagent, ideally through an event, hook, or similar mechanism.
A subagent should only be closed when its work is complete, it has failed, or cancellation is explicitly required.
Ideally, waiting for a subagent should be event-driven rather than implemented through aggressive polling.
Additional information
I would say that in general, subagents are not being managed reliably, not only in these previous points.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
* [Abnormal token consumption: ~678M tokens used while editing 3 resume versions due to repeated multi-agent polling #39854](https://github.com/openai/codex/issues/39854)
* [Remote SSH: `codex_app.wait_threads` has no registered handler while list/read/send remain healthy #40105](https://github.com/openai/codex/issues/40105)
* [Codex Desktop: background turn reported completed/interrupted while JSONL continues without final_answer or task_complete #38972](https://github.com/openai/codex/issues/38972)
Adding a macOS Codex Desktop reproduction with a closely related symptom.
Environment:
Codex Desktop 26.825.51511 on macOS
Bundled Codex CLI 0.151.0-alpha.7.2
Model observed: gpt-5.6-luna
Local run window: 2026-08-31 08:57–09:36 UTC (16:57–17:36 Asia/Shanghai)
The main-thread transcript contained repeated user-visible progress/commentary messages while a healthy subagent was still running. The messages were not limited to the Activity/Subagents panel. Examples from the local rollout (UTC):
There was no Goal mode, no user-typed follow-up, and no explicit steer/stop action from the UI. The Desktop preference followUpQueueMode = “steer” was present, but it was not exercised by a user follow-up. At 09:30:32 UTC, the parent independently invoked the multi_agent_v1__send_input path and injected a “do not wait for further user input; complete and return” message into the still-running worker. This was coordinator intervention after a normal wait timeout, not a user action.
Expected behavior: while a subagent is healthy, the parent should remain idle/event-driven, with no periodic main-transcript commentary and no send_input/steer intervention. It should resume only on completion, an explicit error/interruption/blocked state, or a user-input request. A timeout or unchanged status should be treated as normal.
This macOS/Desktop reproduction seems to fit the reliability and unnecessary-action problem described here. It also appears related to the lower-level repeated parent-turn/wait behavior in #35108. A user-controlled silent-wait/non-intervention mode, or a runtime-managed event-driven wait that does not resample the parent for ordinary timeouts, would address the issue.
No repository contents, credentials, email address, or local filesystem paths are included. Redacted logs can be provided privately if maintainers need them.
Added a measured CLI 0.153.3 direct-v2 reproduction and source findings here: #35108 (comment). The default 60-second developer-level wait/commentary guidance defeated AGENTS.md instructions to use a long mailbox wait. A targeted developer exception plus v2 settings let one wait wake on completion after 187.005 seconds without parent status queries. Repeated parent inference creates excessive token consumption for unchanged status. Please track this as a runtime orchestration defect and test that a healthy child does not cause periodic parent-model calls or unsolicited steering. The linked report distinguishes this direct-v2 behavior from the nested-v1 wrapper path.
I have a Codex CLI reproduction that matches both failure modes described here: premature intervention in a healthy subagent and aggressive polling while waiting.
Environment:
Codex CLI 0.153.1
Windows
Parent: gpt-6-astra / low
Worker: gpt-5.6-luna / xhigh
In one bounded implementation task, the first Luna worker remained active and was making real progress, but the Astra parent interrupted it twice.
After the second interruption, the parent discovered that the worker had already produced a substantial partial patch:
2 files changed
127 insertions
6 deletions
So the worker was not dead or stuck; the parent intervened while useful work was still in progress.
The same run also showed the opposite behavior while waiting:
47 × wait_agent
all 47/47 used timeout_ms = 30000
all 47/47 returned timed_out: true
the parent repeatedly resumed and polled again instead of remaining idle/event-driven
This seems to reproduce both sides of the reliability problem described in this issue: the coordinator either interferes with a healthy worker too early, or repeatedly re-enters the model to poll unchanged status.
I posted the full rollout telemetry and diagnostics here: #35259 (comment)
Recently, I noticed some improvements on how main agent manage the subagent. Now, agents is waiting for subagents tasks reliably when necessary and not going with "random actions" when it should just wait for the subagent to finish the task.
I have a Codex CLI reproduction that matches both failure modes described here: premature intervention in a healthy subagent and aggressive polling while waiting.
In one bounded implementation task, the first Luna worker remained active and was making real progress, but the Astra parent interrupted it twice.
After the second interruption, the parent discovered that the worker had already produced a substantial partial patch:
2 files changed
127 insertions
6 deletions
So the worker was not dead or stuck; the parent intervened while useful work was still in progress.
The same run also showed the opposite behavior while waiting:
* **47 × `wait_agent`**
* all **47/47** used `timeout_ms = 30000`
* all **47/47** returned `timed_out: true`
* the parent repeatedly resumed and polled again instead of remaining idle/event-driven
This seems to reproduce both sides of the reliability problem described in this issue: the coordinator either interferes with a healthy worker too early, or repeatedly re-enters the model to poll unchanged status.
I posted the full rollout telemetry and diagnostics here: #35259 (comment)
They apparentely fixed/improved both issues you also found. You look for it now.
Added a measured CLI 0.153.3 direct-v2 reproduction and source findings here: #35108 (comment). The default 60-second developer-level wait/commentary guidance defeated AGENTS.md instructions to use a long mailbox wait. A targeted developer exception plus v2 settings let one wait wake on completion after 187.005 seconds without parent status queries. Repeated parent inference creates excessive token consumption for unchanged status. Please track this as a runtime orchestration defect and test that a healthy child does not cause periodic parent-model calls or unsolicited steering. The linked report distinguishes this direct-v2 behavior from the nested-v1 wrapper path.
Adding a macOS Codex Desktop reproduction with a closely related symptom.
Environment:
* Codex Desktop 26.825.51511 on macOS
* Bundled Codex CLI 0.151.0-alpha.7.2
* Model observed: gpt-5.6-luna
* Local run window: 2026-08-31 08:57–09:36 UTC (16:57–17:36 Asia/Shanghai)
The main-thread transcript contained repeated user-visible progress/commentary messages while a healthy subagent was still running. The messages were not limited to the Activity/Subagents panel. Examples from the local rollout (UTC):
There was no Goal mode, no user-typed follow-up, and no explicit steer/stop action from the UI. The Desktop preference followUpQueueMode = “steer” was present, but it was not exercised by a user follow-up. At 09:30:32 UTC, the parent independently invoked the multi_agent_v1__send_input path and injected a “do not wait for further user input; complete and return” message into the still-running worker. This was coordinator intervention after a normal wait timeout, not a user action.
Expected behavior: while a subagent is healthy, the parent should remain idle/event-driven, with no periodic main-transcript commentary and no send_input/steer intervention. It should resume only on completion, an explicit error/interruption/blocked state, or a user-input request. A timeout or unchanged status should be treated as normal.
This macOS/Desktop reproduction seems to fit the reliability and unnecessary-action problem described here. It also appears related to the lower-level repeated parent-turn/wait behavior in #35108. A user-controlled silent-wait/non-intervention mode, or a runtime-managed event-driven wait that does not resample the parent for ordinary timeouts, would address the issue.
No repository contents, credentials, email address, or local filesystem paths are included. Redacted logs can be provided privately if maintainers need them.
Exactly, it got some improvements, but I am still testing more complexes orchestrations.
Activity
github-actions commentedon Aug 24, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
codex_app.wait_threadshas no registered handler while list/read/send remain healthy #40105Powered by Codex Action
rafaself commentedon Aug 24, 2026
They don't look related.
LuckyPro-X commentedon Aug 31, 2026
Adding a macOS Codex Desktop reproduction with a closely related symptom.
Environment:
The main-thread transcript contained repeated user-visible progress/commentary messages while a healthy subagent was still running. The messages were not limited to the Activity/Subagents panel. Examples from the local rollout (UTC):
There was no Goal mode, no user-typed follow-up, and no explicit steer/stop action from the UI. The Desktop preference followUpQueueMode = “steer” was present, but it was not exercised by a user follow-up. At 09:30:32 UTC, the parent independently invoked the multi_agent_v1__send_input path and injected a “do not wait for further user input; complete and return” message into the still-running worker. This was coordinator intervention after a normal wait timeout, not a user action.
Expected behavior: while a subagent is healthy, the parent should remain idle/event-driven, with no periodic main-transcript commentary and no send_input/steer intervention. It should resume only on completion, an explicit error/interruption/blocked state, or a user-input request. A timeout or unchanged status should be treated as normal.
This macOS/Desktop reproduction seems to fit the reliability and unnecessary-action problem described here. It also appears related to the lower-level repeated parent-turn/wait behavior in #35108. A user-controlled silent-wait/non-intervention mode, or a runtime-managed event-driven wait that does not resample the parent for ordinary timeouts, would address the issue.
No repository contents, credentials, email address, or local filesystem paths are included. Redacted logs can be provided privately if maintainers need them.
rezzminator commentedon Sep 5, 2026
Added a measured CLI 0.153.3 direct-v2 reproduction and source findings here: #35108 (comment). The default 60-second developer-level wait/commentary guidance defeated AGENTS.md instructions to use a long mailbox wait. A targeted developer exception plus v2 settings let one wait wake on completion after 187.005 seconds without parent status queries. Repeated parent inference creates excessive token consumption for unchanged status. Please track this as a runtime orchestration defect and test that a healthy child does not cause periodic parent-model calls or unsolicited steering. The linked report distinguishes this direct-v2 behavior from the nested-v1 wrapper path.
tagorr commentedon Sep 8, 2026
I have a Codex CLI reproduction that matches both failure modes described here: premature intervention in a healthy subagent and aggressive polling while waiting.
Environment:
In one bounded implementation task, the first Luna worker remained active and was making real progress, but the Astra parent interrupted it twice.
After the second interruption, the parent discovered that the worker had already produced a substantial partial patch:
So the worker was not dead or stuck; the parent intervened while useful work was still in progress.
The same run also showed the opposite behavior while waiting:
wait_agenttimeout_ms = 30000timed_out: trueThis seems to reproduce both sides of the reliability problem described in this issue: the coordinator either interferes with a healthy worker too early, or repeatedly re-enters the model to poll unchanged status.
I posted the full rollout telemetry and diagnostics here:
#35259 (comment)
rafaself commentedon Sep 24, 2026
Recently, I noticed some improvements on how main agent manage the subagent. Now, agents is waiting for subagents tasks reliably when necessary and not going with "random actions" when it should just wait for the subagent to finish the task.
rafaself commentedon Sep 24, 2026
They apparentely fixed/improved both issues you also found. You look for it now.
rafaself commentedon Sep 24, 2026
Interesting.
rafaself commentedon Sep 24, 2026
Exactly, it got some improvements, but I am still testing more complexes orchestrations.