Agent never finishes shutting down in Goal mode ("Closing an agent")

Open 💬 1 comment Opened Jun 27, 2026 by CaixyPromise

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

Version 26.623.42026 • Released Jun 27, 2026

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

In Goal mode, the current agent can get stuck during shutdown and never finishes closing.

After a Goal is paused or the current turn ends, Codex enters the "Closing an agent" state and never completes it.

The Goal itself is not stuck. The problem appears to be that the agent shutdown process never finishes.

<img width="1444" height="1358" alt="Image" src="https://github.com/user-attachments/assets/09c511ed-ae2f-4579-bfa9-f21374198064" />

What steps can reproduce the bug?

  1. Start a Goal in Codex.
  2. Let the agent execute for some time.
  3. Pause the Goal or wait until the current turn finishes.
  4. Observe that Codex enters "Closing an agent".
  5. The shutdown never completes (over 1 hour in my case).

Workaround:

  • Pause the Goal.
  • End the current conversation turn.
  • Continue the Goal.

The Goal resumes normally, indicating that only the previous agent shutdown was stuck.

What is the expected behavior?

The agent should shut down within a reasonable amount of time after completing its work.

If shutdown fails, Codex should either:

  • retry automatically,
  • report an error,
  • or allow the user to force-close the agent.

The UI should never remain indefinitely on "Closing an agent".

Additional information

Additional observations:

  • The issue occurred in Goal mode.
  • The UI remained on "Closing an agent" for more than one hour.
  • During this time, the Goal card remained visible below the current session.
  • I could not determine whether the backend agent was still running or whether only the UI was stuck.
  • Resuming the Goal after pausing and ending the conversation worked normally, suggesting that the Goal state was intact while only the agent shutdown became stuck.

Screenshot attached.

View original on GitHub ↗

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