Codex view resumes a task while its agent loop is shutting down, leaving the task unusable

Resolved 💬 2 comments Opened Jul 19, 2026 by omglazrgunpewpew Closed Jul 19, 2026

What version of the Codex App are you using (From “About Codex” dialog)?

26.715.2305.0 (0.145.0-alpha.18)

What subscription do you have?

ChatGPT Pro 5x

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Occasionally, while using the Codex view in the combined ChatGPT desktop app, an existing task becomes unable to accept another message.

Submitting a follow-up message displays:

Error creating chat
failed to start turn: internal error; agent loop died unexpectedly

Retrying produces the same error. The task remains unusable until I restart the entire desktop app.
The triggering prompt was not persisted because turn/start failed.

<img width="462" height="72" alt="Image" src="https://github.com/user-attachments/assets/d6c09ac9-d5d5-476d-bc7d-3446387ebdd7" />

What steps can reproduce the bug?

The failure is intermittent:

  1. Open an existing task in the Codex view.
  2. Use the task normally. The affected task had previously used subagents.
  3. Leave the task and later return to it.
  4. Submit a follow-up message.
  5. Observe failed to start turn: internal error; agent loop died unexpectedly.
  6. Retry and observe the same failure.
  7. Restart the desktop app. The task becomes usable again.

Affected session ID: 019f7785-fffe-7333-9496-47fd689b76a4
Token-limit and context-window usage were not captured. No code snippet is available because the failure occurs within the desktop task lifecycle.

What is the expected behavior?

Resuming an existing task should leave it able to accept new messages.
If the task is still shutting down, thread/resume should wait or return a recoverable closing response instead of succeeding for a task whose agent loop is about to exit.

Additional information

The local structured logs show this sequence:

2026-07-19T05:08:13.606Z  Shutdown submitted for the affected task
2026-07-19T05:08:24.139Z  thread/resume response composed successfully
2026-07-19T05:08:28.786Z  Shutting down Codex instance
2026-07-19T05:08:28.827Z  Agent loop exited
2026-07-19T05:10:31.976Z  turn/start failed: agent loop died unexpectedly
2026-07-19T05:11:19.652Z  Retry failed with the same error

The ordering suggests that thread/resume can succeed while an already queued shutdown is still able to terminate the same task instance.

Possibly related:
#23971: Subagent close request triggers "agent loop died unexpectedly"
#19197: Persistent orphaned subagents, missing lifecycle controls, and eventual session freezes
#25426: close_agent can hang after a child thread fails to terminate

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗