VS Code extension: expose a public command to open an existing Codex session by ID
Why this appears distinct: #26772 concerns native VS Code Chat Sessions routing, #28779 concerns creating or renaming threads, #20951 concerns editor-tab support generally, and #15807 concerns creating multiple fresh agent editors. I did not find an issue specifically requesting a supported command that opens an already-known local session ID. I may have missed one.
Summary
Please expose a supported VS Code command/API for opening an existing local Codex session by its stable thread/session ID, with a choice of editor tab or sidebar/pane target.
This would let local tools, project dashboards, task trackers, and Markdown indexes link back to the corresponding Codex conversation without depending on private extension routes.
Current behaviour
In the extension version I tested, selecting a conversation from Codex History can open it in a separate editor tab. Inspection of that installed bundle suggested that this uses an openai-codex resource containing /local/<conversationId>.
I could not find a documented public command for opening a specified existing session. It is possible that another supported integration surface exists and I have overlooked it.
A small local bridge successfully opened selected sessions in our environment by invoking the observed resource. I would not assume that this resource is a stable interface:
- the resource format is undocumented;
- extension updates can change it;
- its intended calling contract is unclear;
- behaviour across local, WSL, Remote SSH, and multi-window environments is not documented.
Use case
I maintain a local read-only catalogue of Codex sessions. It groups sessions by project and subject, shows status and latest activity, exports readable transcripts, and links each catalogue entry back to Codex.
Other likely integrations include:
- project dashboards and handoff records;
- Jira, GitHub, or Planner task-to-thread mappings;
- session search and history utilities;
- editor commands and keyboard shortcuts;
- accessibility and workflow automation.
Possible API
For example, a command could look like:
const result = await vscode.commands.executeCommand(
"chatgpt.openSession",
{
sessionId: "00000000-0000-4000-8000-000000000001",
target: "editor", // "editor" | "sidebar"
viewColumn: vscode.ViewColumn.Beside,
preserveFocus: false,
},
);
If useful, the result could contain the resolved identity and target:
{
sessionId: string;
target: "editor" | "sidebar";
cwd?: vscode.Uri;
}
A documented URI handler could additionally support Markdown links:
vscode://openai.chatgpt/session/<session-id>?target=editor
Suggested behaviour
- Opens an existing local session by stable ID.
- Supports both editor-tab and sidebar/pane targets.
- Can open several different sessions in separate editor groups.
- Documents expected behaviour for local, WSL, and Remote SSH extension hosts.
- Returns a clear error for missing, archived, inaccessible, or malformed IDs.
- Does not require callers to read Codex session files directly.
- Does not expose transcript contents to the caller merely by opening a thread.
- Documents the command ID, arguments, return value, and URI format.
Related issues
#26772— route native VS Code Chat Sessions items to/local/<conversationId>.#28779— public API to create or rename Codex IDE threads.#20951— support Codex sessions as editor tabs.#15807—New Codex Agentcurrently behaves as a singleton editor.
My intention is narrower than general history UI or tab management: a supported integration point when the caller already knows the session ID.