Skip to content

VSCode Plugin bug: Could not open multiple windows via Codex: New Codex Agent #15807

Open

Description

@huangwb8

What version of the IDE extension are you using?

26.5324.21329、26.5323.20928、26.5318.11754

What subscription do you have?

API

Which IDE are you using?

VS Code

What platform is your computer?

Darwin 25.3.0 arm64 arm

What issue are you seeing?

  • F1
  • Click Codex: New Codex Agent , a window was open. Strangely:
    • users could not check history conversations
    • Working CPU/Memory consume increases than ever versions (I'm not sure whether this is the bug of vscode plugin or codex ). My Mac Mini M4 (16G mem) has to kill other application when use Codex: New Codex Agent. However, if i use Codex: Open Codex Sidebar, that seemed normal.
  • Click Codex: New Codex Agent Again. Could not open a new conversation

What steps can reproduce the bug?

The same as What issue are you seeing?

What is the expected behavior?

  • F1
  • Click Codex: New Codex Agent , a window was open.
    • users could check history conversations if they want
    • Working CPU consume keeps normal
  • Click Codex: New Codex Agent Again. A new conversation could be opened

Additional information

NULL

Activity

  1. added
    extension
    on Mar 25, 2026
  2. added
    bug
    on Mar 25, 2026
  3. huangwb8 commented on Mar 25, 2026

    @huangwb8
    Author

    I checked the repo and found some similar community reports.

    The closest one is #15552. It reports that after version 26.5318.11754, Codex: New Codex Agent could only open 1 window, which is very close to what I am seeing here.

    Also looks related:

    For the side symptoms in this issue:

    So from my side, this may not be an isolated bug. It looks more like the same extension regression family around New Codex Agent, conversation creation, and thread/history state management.

    Leaving these issue links here for triage.

  4. isCopyman commented on Mar 26, 2026

    @isCopyman

    Yes, I also found this problem

  5. galaczi commented on May 5, 2026

    @galaczi

    This is open since March without any attention? I can have only one Codex agent open at a time, that's a big hit on productivity. I guess it's affecting only a small subset of users, otherwise it would have been fixed for sure.

  6. songlocd14 commented on May 15, 2026

    @songlocd14

    I dug into the shipped VS Code extension bundle on macOS and this looks like an extension implementation issue rather than a keybinding/config issue.

    Environment I checked:

    • VS Code extension: openai.chatgpt 26.513.21555
    • VS Code user keybinding bound cmd+n to chatgpt.newCodexPanel when a Codex custom editor is focused

    What I found in the installed extension:

    • The docs say chatgpt.newCodexPanel is “Create a new Codex panel”: https://developers.openai.com/codex/ide/commands
    • The extension registers the custom editor with supportsMultipleEditorsPerDocument: false
    • createNewPanel() always opens the same custom-editor URI: __('/extension/panel/new')
    • Conversation/history tabs are separate because their URIs include /local/:conversationId (or /remote/:taskId), while the “new panel” URI is effectively a singleton
    • chatgpt.newChat is sidebar-oriented in this build: the command title is “New Thread in Codex Sidebar”, its menu contribution is restricted to sidebar webviews, and the runtime sends { type: 'new-chat' } to sidebarView.webview

    Relevant bundled-code snippets from the installed extension:

    1. Custom editor registration disables multi-editor docs:
    registerCustomEditorProvider(wl.customEditorViewType, tt, {
      webviewOptions: { retainContextWhenHidden: !0 },
      supportsMultipleEditorsPerDocument: !1
    })
    1. New Codex Agent always opens the same URI:
    async createNewPanel() {
      let e = __("/extension/panel/new"),
          r = Ie.window.activeTextEditor?.viewColumn ?? Ie.ViewColumn.Active;
      await Ie.commands.executeCommand("vscode.openWith", e, t.customEditorViewType, {
        viewColumn: r,
        preserveFocus: !1,
        preview: !1
      })
    }
    1. URI parsing only treats local/remote conversation routes as unique conversations:
    function S_(t) {
      let { scheme: e, authority: r, path: n } = t;
      if (e !== Bu) return null;
      if (r !== Mee) return null;
      let i = (n.startsWith("/") ? n.slice(1) : n).split("/"), s = null;
      return i.length >= 2 && (i[0] === "local" || i[0] === "remote") && (s = i[1]),
        { path: t.fsPath, conversationId: s };
    }
    1. newChat targets the sidebar webview:
    triggerNewChatViaWebview() {
      this.sidebarView && this.sidebarWebviewReady &&
        this.postMessageToWebview(this.sidebarView.webview, { type: "new-chat" })
    }

    This matches the user-visible behavior exactly:

    1. Cmd+Shift+P -> Codex: New Codex Agent or cmd+n on a Codex tab does not create another fresh tab; it reuses/focuses the existing /extension/panel/new tab.
    2. Historical chats can open in separate tabs because they have distinct conversation URIs.
    3. Clicking New chat from a task tab routes back toward the singleton “new” panel/sidebar flow instead of spawning another independent tab.

    Likely fixes:

    • Give each new panel a unique URI (for example the same route plus a unique query/hash/token), and/or
    • Register the custom editor with supportsMultipleEditorsPerDocument: true

    Right now the docs wording and the shipped extension behavior do not line up for users expecting multiple Codex tabs/panels in VS Code.

  7. JoelMTaylor commented on Jul 28, 2026

    @JoelMTaylor

    I appear to be seeing the same user-visible behaviour with a newer VS Code extension on Windows using a Remote SSH extension host:

    • VS Code extension: openai.chatgpt 26.721.41059
    • Codex: New Codex Agent opens or focuses the singleton new-agent editor.
    • Running the command again does not create another independent fresh editor.

    Separately, we built a small local-only VS Code bridge for a Markdown session catalogue. Unlike approaches that patch the installed Codex extension, this helper leaves the official extension unchanged and asks VS Code to open the observed local-conversation resource for a supplied session ID. It worked in our environment, including opening several different established sessions as editor tabs.

    This does not establish that the observed resource is intended for third-party use. It may suggest that a small public open existing session command could support catalogue and task-tracker integrations without relying on the observed private resource. The narrower API request was submitted as https://github.com/openai/codex/issues/35694.

  8. isCopyman commented on Aug 5, 2026

    @isCopyman

    There is a built-in workaround for opening multiple existing Codex sessions, without patching the extension:

    1. Open VS Code's built-in Chat / Agent Chat view.
    2. Open the Sessions list (or Session History).
    3. Select an existing Codex session.
    4. Repeat with other sessions. They open as separate editor tabs and can coexist.

    This matches the implementation detail noted above: established conversations have distinct conversation IDs, so VS Code can open them as separate editor resources.

    Important limitation: this does not fix the reported bug in Codex: New Codex Agent. That command still reuses/focuses the singleton new-agent panel instead of creating multiple fresh panels. It is only a practical workaround for established sessions.

    A similar workaround with screenshots was also documented in #20951: #20951 (comment)

  9. elijahchancey commented on Aug 10, 2026

    @elijahchancey

    Still reproducible in the current stable extension:

    • Extension: openai.chatgpt 26.803.41515
    • IDE: VS Code 1.132.0
    • Platform: macOS
    • The toolbar New Chat control does nothing.
    • Running Codex: New Codex Agent again only focuses the existing Codex session; it does not create a new independent conversation/tab.

    I also checked the installed extension bundle and can confirm the implementation described above is still present: the custom editor is registered with supportsMultipleEditorsPerDocument: false, and createNewPanel() opens the same /extension/panel/new URI each time. That makes the panel behave as a singleton.

    The required workflow is multiple independently switchable Codex sessions, each with separate conversation context, inside one VS Code workspace/window. Using separate CLI terminals provides context isolation, but loses the panel's native inline-diff/review UX.

  10. dlsfldl commented on Aug 26, 2026

    @dlsfldl

    Still reproducible in the current VS Code extension, with a more precise description of the tab/session behavior below.

    Scope

    This concerns Codex opened as VS Code editor tabs, not the Codex sidebar.

    Environment

    • OS: Windows 11 x64 (build 26200)
    • VS Code: 1.134.0
    • Codex IDE extension: openai.chatgpt 26.820.60940

    Reproduction and actual behavior

    1. Open Codex: New Codex Agent. This creates the initial "new session" editor tab.
    2. Start a session in that tab.
    3. Select another session from History. Codex opens that session in a separate editor tab.
    4. Click New Session in the original tab: nothing happens.
    5. Click New Session in another session tab: VS Code only focuses the original tab; no new session is created.
    6. Close the original tab, then click New Session from another session tab: only now can a new session be opened.
    7. Selecting sessions from History always opens another editor tab rather than navigating the current tab.

    Primary expected behavior

    The initial tab may begin as a temporary "new session" placeholder. Once a session is started successfully, that tab should become bound to the created session and be treated as that session's normal editor tab.

    After that conversion, invoking New Session should create or open a fresh placeholder tab for the next session. It should not keep routing every later New Session action to the original, already-used tab.

    Opening History sessions in separate tabs may be an intentional UX choice or preference. The primary defect is that the original placeholder never stops being treated as the singleton "new session" target, which blocks later session creation.

    Implementation observation

    Local inspection of the shipped bundle shows that createNewPanel() always opens the same /extension/panel/new custom-editor URI, while the provider is registered with supportsMultipleEditorsPerDocument: false. This is consistent with VS Code repeatedly focusing the stale singleton placeholder instead of creating a usable new-session tab.

    No project files, credentials, or private logs are included.

  11. kswhitecross commented on Sep 22, 2026

    @kswhitecross

    Still encountered on macOS 26.6.2 (Apple Silicon), VS Code 1.131.0. Reproduced with openai.chatgpt 26.908.40401; the same implementation is present in 26.917.51856.

    With an existing Codex editor tab open, Codex: New Codex Agent and the in-pane New chat control focus/reuse the existing new-agent tab rather than opening another usable independent chat. The command can open a panel when that tab has been closed.

    Local inspection confirms the earlier findings: createNewPanel() passes the same /extension/panel/new resource to vscode.openWith, and the custom editor is registered with supportsMultipleEditorsPerDocument: false.

    Please fix and test the complete draft-to-conversation lifecycle: starting a conversation should release or correctly transition the new-chat placeholder so a subsequent New Chat action can create a fresh chat, while existing histories and restored editor tabs continue to open normally. An arbitrary unique suffix on the editor URI is not a workaround I can recommend as validated; routing, restoration, and draft state need to be handled together.

    Separately, repeated onboarding is tracked in #25146. That issue reproduced even when onboarding-completed flags were already persisted, so clearing history or resetting all Codex state does not appear justified.

  12. travelersmap commented on Sep 24, 2026

    @travelersmap

    Still reproducible in openai.chatgpt 26.917.62051 on VS Code Remote-SSH / Linux x64.

    I inspected the shipped extension bundle and found a concrete cause:

    • chatgpt.newCodexPanel constructs the fixed custom-editor URI /extension/panel/new.
    • The in-webview New Chat action delegates to that same command.
    • Repeated invocations therefore resolve to the same VS Code custom-editor resource, so VS Code focuses/reuses the existing tab instead of creating an independent editor.
    • Placement is derived from activeTextEditor?.viewColumn, which can point at a different split from the Codex panel that originated the action.
    • On restart, restored Codex tabs are reopened without preserving each tab group's viewColumn.

    This combination reproduces both symptoms: a second New Chat replaces/reuses the existing agent tab, and a split can be emptied or collapsed because the tab is reopened in the wrong editor group.

    A local proof of concept fixed the behavior by:

    1. giving each new panel a resource such as /extension/panel/new?n=<128-bit random nonce>;
    2. routing the webview New Chat action directly with its originating webview, then using that panel's group;
    3. using window.tabGroups.activeTabGroup.viewColumn only for command-palette fallback;
    4. reopening restored tabs with their recorded group.viewColumn.

    The behavioral test opened 100 New Chat panels and verified 100 unique resources, correct originating-group placement, active-group fallback, and split restoration.

    Please make unique custom-editor identity and originating-group placement part of the upstream implementation. The fixed URI is still present in the current build.

  13. anindyamahajan commented on Oct 13, 2026

    @anindyamahajan

    Still reproduced with openai.chatgpt 26.1007.21434 on macOS 26.5.2, Apple Silicon, VS Code 1.140.0.

    Repeatedly invoking Codex: New Codex Agent opens the first editor tab, then only focuses that same tab. The same behavior occurs when the editor-title toolbar button is locally bound to chatgpt.newCodexPanel.

    Inspection of this installed version confirms the fixed /extension/panel/new resource is still passed to vscode.openWith, with preview: false, and the custom editor is registered with supportsMultipleEditorsPerDocument: false. Disabling preview does not give successive invocations distinct document identities.

    A local workaround gives each draft panel the same route with a fresh random panelId query parameter. After reloading VS Code, successive toolbar clicks created separate tabs; the user confirmed this works. A small behavioral check executing the extracted command with a mocked VS Code opener also verified that three calls produce three distinct resource URIs. This is a local workaround, not a validated upstream patch: we have not established the full draft-to-conversation, restoration, split-placement, or history behavior.

    Please make the explicit New Codex Agent action create a fresh independent editor tab while preserving existing chats. Regression coverage should include repeated invocations both before and after sending the first message, conversion of a draft to a saved conversation, correct editor-group placement, and restored tabs.

    The one-click toolbar request is tracked in #53071. Repeated onboarding is separately tracked in #25146 and also occurred here despite saved completion flags; changing document identity alone does not resolve that issue.

  14. elfege commented on Oct 16, 2026

    @elfege

    Still encountering this. Creating another agent requires closing the existing tab, invoking New Codex Agent again, and repeating onboarding. An explicit “New Agent” action should create an independent tab—not force a close/reopen loop.

  15. elfege commented on Nov 5, 2026

    @elfege

    Bravo. We have apparently graduated from the onboarding carousel to the blank-chat dead end. A bold improvement: fewer introductory screens, fewer ways to get back to actual work.

    Following up on my earlier comment here and the related repeated-onboarding report, this is the behavior I am now seeing in my current Codex VS Code installation:

    1. Run Codex: New Codex Agent.
    2. An empty chat opens in an editor tab.
    3. Existing conversations remain accessible through the navigation history.
    4. I cannot reopen those conversations from that history into independent editor tabs. The new editor surface gives me no usable history-to-tab recovery path.

    An empty new chat is not itself the problem. The problem is that the existing conversations I need are stranded outside the editor-tab workflow. Removing the onboarding obstacle while leaving history reopening unusable is not a working recovery flow.

    What, exactly, is the release-blocking QC check for this? From the user side, effective quality control for this basic workflow looks nonexistent. If CI considers this releasable, it is testing the wrong thing. A green check for “the command ran” is worthless when the user still cannot reopen their work.

    Please cover the complete workflow end to end: already-onboarded user → new editor panel → history → existing conversation in an editor tab → second independent tab → close/reload → reopen the same conversations, without replaying onboarding or forcing replacement chats.

    These are basic editor navigation and state-persistence requirements. Users should not need to build their own session-restoration tooling to compensate for their absence. Bravo, again.

  16. kurevin commented on Dec 1, 2026

    @kurevin

    Omg...I just tried to use the Codex for vscode after using Claude Code...and it absolutely terrible, in CC I have about 20 tabs, some of them a month old with persistent context, in Codex being limited to one tab and not having session restore feature feels like using hacksaw to amputate own limbs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions