VS Code extension: stale thread owner blocks chat with “open in another application” (autogen selfreport from codex)
Summary
The VS Code extension can leave a thread owned by another Codex client after a VS Code Web renderer reloads or disconnects.
A different live client then shows the localized equivalent of:
This chat is open in another application. To continue here, close the chat elsewhere.
The UI does not identify the owning client. It also provides no supported way to release a stale owner or take over the thread.
Environment
- Codex VS Code extension:
openai.chatgpt 26.803.41515-linux-x64 - VS Code Web:
1.132.0 - Extension host: Linux x86_64
- Browser client: Firefox
153.0.3on Windows 11 - Several VS Code Web windows connected to the same remote Codex state
Observed sequence
- Open a Codex thread in one VS Code Web window.
- Connect another VS Code Web window to the same remote host and Codex state.
- Reload or disconnect one window while the Codex webview is starting.
- Open or continue the thread from another live window.
- Codex reports that the chat is open in another application.
- The user must find and close stale clients or terminate processes manually.
The problem is intermittent, but the process and log state is consistent when it occurs.
Diagnostic evidence
Each VS Code extension host starts a separate child process:
extensionHost
└─ codex ... app-server --analytics-default-enabled
Several of these app-server instances can remain active at the same time.
Multiple extension logs receive the same broadcast:
[IpcClient] Received broadcast but no handler is configured method=thread-stream-following-changed
A disconnected extension host can remain alive until the renderer reconnection grace period expires:
Extension host terminating: renderer disconnected for too long (2)
The thread data remains present. Authentication and model requests are not the failure. The blocking state is thread ownership or stream-following state.
Expected behavior
- Release thread ownership promptly when its webview or client disconnects.
- Do not let an app-server owned only by a disconnected renderer block another live client.
- Identify the owning client in the error message.
- Provide a Take over here action that safely invalidates a stale owner.
- Keep separate threads and workspaces independent when several VS Code windows are active.
Actual behavior
A stale or duplicate client can block an active thread with no recovery action in the UI. This is disruptive for long-running tasks and multi-window workflows.
Related issues
- #18963 describes workspace-specific stuck threads, but not the explicit ownership message.
- #35598 reports gray webviews and unhandled
thread-stream-following-changedbroadcasts, but not stale ownership or takeover.
No usernames, hostnames, IP addresses, local paths, account identifiers, thread IDs, or raw logs are included.
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I am experiencing the exact same issue in the exact same set of circumstances. I am on Ubuntu 24.04, in VScode 1.132, Codex 26.803.61601
I also started seeing this issue on August 9th. Started simulataneously to both work and personal Codex account.
Still seeing issue on:
Codex VS Code extension:26.803.61601
Windows 11.
The two exact messages I get when trying to open the chat are:
• "Error creating chat thread 019** already has an active writer"
• "This task is active elsewhere. Close it there, then retry here."
Confirmed on VS Code Remote-SSH with the Codex extension
openai.chatgpt 26.5814.41407-linux-arm64.Observed evidence:
turn_aborted, but the old UI continued to display Thinking and would not accept or return messages.futex_wait_queue/ep_poll; the newly connected extension host had a separate active app-server.SIGTERMto only the two old extension-host process trees removed their stale Codex app-servers. The current extension host, current Codex backend, remote VS Code server, and long-lived Codex MCP service remained running.This confirms that Remote-SSH reconnection can leave the previous extension-host/app-server generation alive and preserve stale thread/UI ownership even when the corresponding turn is no longer running. Reconnect should retire the old generation or release its thread/stream-following state before activating the replacement.
I'm experiencing this exact issue with the Codex VS Code extension.
In my case, Codex is NOT open in another application, another VS Code window, the Codex desktop app, or another browser/IDE.
I have only one VS Code instance open, connected through Remote SSH, and Codex still displays:
"This is open in another app. Close it there to continue here."
Clicking Retry does not resolve it.
This appears to be a stale thread ownership / app-server state rather than an actual second Codex client.
Environment:
Screenshot available showing the error.
<img width="1097" height="1032" alt="Image" src="https://github.com/user-attachments/assets/64c19795-c7cd-4e25-9091-9d0c44d2b14f" />
Please add a "Take over here" / force-release mechanism, or automatically clear stale ownership when the previous app-server/client is no longer active.
Same deal breaker for a task started with the CLI on a host, and monitoring/steering from the app's "remote" thread (desktop and mobile). The thread is harder to "expose" in the app, and once it's visible, any attempt to interact with it is now verboten.
<img width="756" height="90" alt="Image" src="https://github.com/user-attachments/assets/66c027cf-a1f9-468b-810d-0f891bd00593" />
This can be solved by running "pkill -TERM -u "$USER" -f '[c]odex.*app-server" on terminal after closing all the IDE. However, this's only a temporary solution.
I reproduced the same ownership issue on Windows with VS Code + iPhone Remote Control. I added OS-level writer-lock evidence and a proposed “Take over here” ownership handoff flow in #40157.