Codex task becomes stuck if VS Code is closed while the agent is running

Open 💬 3 comments Opened Mar 4, 2026 by bymehul
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the IDE extension are you using?

0.5.80

What subscription do you have?

Go

Which IDE are you using?

VS Code

What platform is your computer?

Linux 6.14.0-29-generic x86_64 x86_64

What issue are you seeing?

If Codex is executing a task and VS Code is closed before the task finishes, the task becomes stuck when VS Code is reopened.

<img width="425" height="539" alt="Image" src="https://github.com/user-attachments/assets/88832e83-ac5a-45f3-825d-bc0d7a16805e" />

The Codex panel shows the task in a "Thinking" or running state. The Stop or Pause buttons do not stop the task and the agent does not recover from the interrupted session.

What steps can reproduce the bug?

If Codex is executing a task and VS Code is closed before the task finishes, the task becomes stuck when VS Code is reopened.

The Codex panel shows the task in a "Thinking" or running state. The Stop or Pause buttons do not stop the task and the agent does not recover from the interrupted session.

What is the expected behavior?

If VS Code is closed while Codex is running a task, the extension should either:

  1. Cancel the running task automatically, or
  2. Restore the task to a stoppable state when VS Code is reopened.

Additional information

Pressing Stop or Pause does not resolve the issue.

The task remains stuck in the UI and the agent appears unable to recover from the interrupted session.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #13379
  • #12843
  • #12382

Powered by Codex Action

etraut-openai contributor · 5 months ago

If you're able to repro this, could you please use the /feedback slash command to upload the session when it's in this "stuck" state? Then post the thread ID here so I can review the session details.

bymehul · 5 months ago

@etraut-openai
Thread Id: 019cb9bd-86bc-7ef1-bde4-ded954540fe2
Video ref below:

https://github.com/user-attachments/assets/6778275a-ba5d-4e4e-920f-13a7ba52bbb8