Vscode extension: Add a folder to your workspace to use Codex

Resolved 💬 22 comments Opened Nov 19, 2025 by wiegell Closed Dec 4, 2025

What version of Codex is running?

codex --version codex-cli 0.58.0, vscode extension v0.5.43

What subscription do you have?

Paid

Which model were you using?

GPT-5.1-medium

What platform is your computer?

MacOS

What issue are you seeing?

I get this error:
<img width="585" height="180" alt="Image" src="https://github.com/user-attachments/assets/3967134b-fae6-42fe-a0b4-3b54ea81eb12" />

What steps can reproduce the bug?

Atm. whenever i start a new chat like this it happends
<img width="613" height="118" alt="Image" src="https://github.com/user-attachments/assets/6cde8c40-0147-4fb5-a7b3-9f69d19a17d7" />

What is the expected behavior?

Should just work

Additional information

This is not happening, when prompting via the sidebar.
This has been happening for the last week or so

View original on GitHub ↗

22 Comments

SKp80uw30 · 8 months ago

Same thing here

xXAvoraXx · 8 months ago

++

seohyung-plead · 8 months ago

Me too. It happened from yesterday's new chat.

<img width="740" height="826" alt="Image" src="https://github.com/user-attachments/assets/2e551638-9928-4798-b7b7-507f4c1bb929" />

soroka-pdffiller · 8 months ago

++

hylandalex119-cloud · 8 months ago

same problem

mcfongtw · 8 months ago

++ It happened right after I upgrade codex just now 👎

bschnorenberg · 8 months ago

Bug Report: “New Codex Agent” (+ button) no longer creates agent sessions (regression in pre-release 0.5.46)

Summary

In OpenAI VS Code Extension (pre-release v0.5.46), the “+ New Codex Agent” button in the OpenAI Codex sidebar no longer creates a functional agent session.
This is a regression from behavior ~3 days ago, where the same button correctly spawned fully-functional local agent sessions.

Expected Behavior (previous pre-release versions)

Clicking the + button with tooltip “New Codex Agent” should:

  1. Create a new agent session bound to the local runtime
  2. Allocate a new session ID
  3. Display a chat input panel bound to that session
  4. Populate the AGENT SESSIONS list
  5. Enable all agent features:
  • bidirectional chat
  • patch tasks
  • Codex task view
  • parallel tasks per session
  • diff/patch UI

This was functioning correctly earlier this week.

Actual Behavior (v0.5.46)

Clicking + New Codex Agent now:

  1. Creates a legacy chat placeholder, not an agent session
  2. Does not allocate a session ID
  3. Does not open a chat input panel
  4. Shows a dead “Codex task” tab on the right
  5. Displays the fallback modal:
Unable to send message
Add a folder to your workspace to use Codex
  1. Does not start or attach to the agent backend, even though:
  • The agent daemon is running (verified via ps aux)
  • The workspace is trusted
  • The folder is root-opened
  • The extension backend is installed and activated
  • Other session creation paths work

Repro Steps

  1. Install OpenAI VS Code extension pre-release v0.5.46
  2. Open a local folder as the workspace root
  3. Ensure the local agent runtime activates (daemon shows in ps aux)
  4. Open the OpenAI Codex sidebar
  5. Click the + button (tooltip “New Codex Agent”)

Result:
A non-functional placeholder session appears in the session list.
No agent session is created.
No chat surface appears.
Codex panel shows fallback UI.

Expected:
A new agent session is created and fully interactive.

Other Information

  • Starting sessions via:

OpenAI: Start Agent Sessionworks

  • Starting sessions via Chat panel (“Local | Agent | GPT-5.1-Codex”) → works
  • Only the sidebar + New Codex Agent path is broken
  • This used to behave correctly in 0.5.43 / 0.5.44
  • Tooltip text still says “New Codex Agent” but the underlying command now maps to the legacy chat path

Diagnosis

The + button is still bound to the old chat.new command instead of the new agent session creation command (agent.newSession).
Auto-promotion from Chat → Agent was removed, exposing the mismatch.
The UI label was updated, but not the command wiring.

Impact

  • Users cannot create new local agent sessions from the Codex sidebar
  • Users assume the extension is broken or misconfigured
  • The feature that previously supported multiple parallel sessions through the sidebar now only supports them via Chat-based initiation
  • Highly confusing UX regression

Suggested Fix

  • Rebind the + button in the OpenAI Codex sidebar to the correct handler:

``
openai.agent.newSession
``

  • Remove or disable legacy fallback UI in Codex task view
  • Ensure the “New Codex Agent” tooltip matches actual behavior
  • Re-enable auto-binding of newly-created session to chat panel
interconnectedMe · 8 months ago

Same kind of issue.
Just updated to :

Identifier
openai.chatgpt
Version
0.4.46
Last Updated
2 hours ago
Size
71.69MB

Have a separate window on left-hand screen.
Codex opened as a tab in that separate window.
Type prompt.
"Unable to send message
Add a folder to your workspace to use Codex"

Same message for:

  • Local/Chat/GPT-5.1/Medium
  • Local/Agent (full access)/GPT-5.1-Codex-Max/Medium

Have not tested with other combinations.

I've reopened the chat sidebar now to check, and I do get a normal response (e.g. asking 'are you there? : 'Yes, I’m here and ready to help. What would you like to work on in this project?')

I can't confirm if this was the same behaviour on the previous version of the extension (I think I was on 0.4.43 before updating today). I did not have separate windows for my chats, just used the sidebar.

devsin · 8 months ago

Could you please guys try with official OpenAI Codex extension?

<img width="452" height="751" alt="Image" src="https://github.com/user-attachments/assets/f7ce830e-a21c-4d44-a148-34eac0cf9af9" />

xXAvoraXx · 8 months ago
Could you please guys try with official OpenAI Codex extension? <img alt="Image" width="452" height="751" src="https://private-user-images.githubusercontent.com/56631337/517721976-f7ce830e-a21c-4d44-a148-34eac0cf9af9.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjM4MjU1NTcsIm5iZiI6MTc2MzgyNTI1NywicGF0aCI6Ii81NjYzMTMzNy81MTc3MjE5NzYtZjdjZTgzMGUtYTIxYy00ZDQ0LWExNDgtMzRlYWMwY2Y5YWY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTIyVDE1MjczN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRkY2NmNGFiZDNmOTAyYTY3OWM2MGNjNzI3MzcxNDM5YzAwNGFmMTE4NDdiNDU0MWQ3MDAwYzBjMjBkNjBkNzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fbiF_AkEbxnm2zzAy4zu6zTH6CjNrnB7M9FR_J2GhgQ">

There is no issue when using the official OpenAI extension. The problem is that I want to continue from my chat history, but since I cannot access my chat history in the official OpenAI extension, we have to start over every time. Since OpenAI chat history is available in agent sessions, everyone here is trying to continue their past chats, and that's why we are getting warnings.

devsin · 8 months ago
There is no issue when using the official OpenAI extension. The problem is that I want to continue from my chat history, but since I cannot access my chat history in the official OpenAI extension, we have to start over every time. Since OpenAI chat history is available in agent sessions, everyone here is trying to continue their past chats, and that's why we are getting warnings.

i think you're in the wrong ticket, mate. no one else has mentioned chat history in this ticket before.

xXAvoraXx · 8 months ago
> There is no issue when using the official OpenAI extension. The problem is that I want to continue from my chat history, but since I cannot access my chat history in the official OpenAI extension, we have to start over every time. Since OpenAI chat history is available in agent sessions, everyone here is trying to continue their past chats, and that's why we are getting warnings. i think you're in the wrong ticket, mate. no one else has mentioned chat history in this ticket before.

The root of the problem is the same. Yes, it can be run smoothly through a chat using the OpenAI extension, but when you close and reopen your work, you can’t continue from your chat history. If you want to continue from your chat history, you encounter the warning that is the subject of this ticket issue. I’m currently experiencing this problem myself.

devsin · 8 months ago
> > There is no issue when using the official OpenAI extension. The problem is that I want to continue from my chat history, but since I cannot access my chat history in the official OpenAI extension, we have to start over every time. Since OpenAI chat history is available in agent sessions, everyone here is trying to continue their past chats, and that's why we are getting warnings. > > > i think you're in the wrong ticket, mate. no one else has mentioned chat history in this ticket before. The root of the problem is the same. Yes, it can be run smoothly through a chat using the OpenAI extension, but when you close and reopen your work, you can’t continue from your chat history. If you want to continue from your chat history, you encounter the warning that is the subject of this ticket issue. I’m currently experiencing this problem myself.

I suspect you might not be looking at the correct view in VS Code, and you may not be aware that there are multiple AI tools available there.

There are three different tools involved:

  1. Agent Session View (built into VS Code)
  1. GitHub Copilot Chat (the oldest AI client)
  • This is an extension you install.
  • You can have a normal chat here with your preferred AI model.
  • <img width="301" height="83" alt="Image" src="https://github.com/user-attachments/assets/e27325fb-c7ef-493d-9463-910e02fa4746" />
  1. Official OpenAI Codex extension
  • This is also an extension you need to install separately.
  • <img width="300" height="89" alt="Image" src="https://github.com/user-attachments/assets/4c154a3d-4f91-4f0e-97c5-90601e4d4c51" />

---

The problem

When I try to start a Codex session in the Agent Session View, I get the error mentioned in this ticket.

However, if I start a chat using the official OpenAI Codex extension, everything works fine and I don’t get that error.

---

Possible confusion

I’m also suspicious that you might have forgotten to change the view / provider in either GitHub Copilot Chat or Agent Session.

You can switch it by clicking the three dots in the top-left corner of the chat panel and selecting the correct view (for example, switching between Chat (Github Copilot Chat) and Agent Sessions:

  • <img width="284" height="144" alt="Image" src="https://github.com/user-attachments/assets/51f230c2-43de-45cc-96a1-639406120e34" />
xXAvoraXx · 7 months ago

Thanks for clarifying the differences between the chat views.
I’m using the Agent Sessions option (from the sidebar) and can access my agent chat history, but whenever I select a previous chat to continue, I still get the “Add a folder to your workspace to use Codex” warning.
I’ve double-checked that all extensions and VS Code are up to date, and there is no provider selection just a switch between “Chat” and “Agent Sessions”.

Starting a new agent chat works fine, but resuming an old session always results in the same warning. Is there any workaround for this, or anything else I should try?

<img width="877" height="575" alt="Image" src="https://github.com/user-attachments/assets/0e0b6ae5-9100-484a-8c60-f0bdceda3cfd" />

paulofp79 · 7 months ago

I'm having same issue here. any fix ?

Nickheythatsme · 7 months ago

++

jodishwaran · 7 months ago

++

devsin · 7 months ago
Thanks for clarifying the differences between the chat views. I’m using the Agent Sessions option (from the sidebar) and can access my agent chat history, but whenever I select a previous chat to continue, I still get the “Add a folder to your workspace to use Codex” warning. I’ve double-checked that all extensions and VS Code are up to date, and there is no provider selection just a switch between “Chat” and “Agent Sessions”. Starting a new agent chat works fine, but resuming an old session always results in the same warning. Is there any workaround for this, or anything else I should try? <img alt="Image" width="877" height="575" src="https://private-user-images.githubusercontent.com/6988989/517824852-0e0b6ae5-9100-484a-8c60-f0bdceda3cfd.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjQwMjYxMTIsIm5iZiI6MTc2NDAyNTgxMiwicGF0aCI6Ii82OTg4OTg5LzUxNzgyNDg1Mi0wZTBiNmFlNS05MTAwLTQ4NGEtOGM2MC1mMGJkY2VkYTNjZmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MTEyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTExMjRUMjMxMDEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGQ3YzY2OGVkZmZlYjk1Zjg1MjI0NGYwZGVhMmM4N2E5ODEwZWQxODZmOTBlMWFiZDkwODk5NTUxZDdlMmRjYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.EnmIlgwmxiX_pJtEAAtFVuj72Xj2H20h0CcnWLL34fw">

Did you try to continue your chat with Official OpenAI Codex extension? You might continue to your chat without issue with this extension. I think agent Sessions views is buggy at the moment.

<img width="600" height="178" alt="Image" src="https://github.com/user-attachments/assets/f0bd1763-e9fe-45cd-b04f-1b4e985fe680" />

xXAvoraXx · 7 months ago
> Thanks for clarifying the differences between the chat views. I’m using the Agent Sessions option (from the sidebar) and can access my agent chat history, but whenever I select a previous chat to continue, I still get the “Add a folder to your workspace to use Codex” warning. I’ve double-checked that all extensions and VS Code are up to date, and there is no provider selection just a switch between “Chat” and “Agent Sessions”. > Starting a new agent chat works fine, but resuming an old session always results in the same warning. Is there any workaround for this, or anything else I should try? > <img alt="Image" width="877" height="575" src="https://private-user-images.githubusercontent.com/6988989/517824852-0e0b6ae5-9100-484a-8c60-f0bdceda3cfd.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjQwMjYxMTIsIm5iZiI6MTc2NDAyNTgxMiwicGF0aCI6Ii82OTg4OTg5LzUxNzgyNDg1Mi0wZTBiNmFlNS05MTAwLTQ4NGEtOGM2MC1mMGJkY2VkYTNjZmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MTEyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTExMjRUMjMxMDEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGQ3YzY2OGVkZmZlYjk1Zjg1MjI0NGYwZGVhMmM4N2E5ODEwZWQxODZmOTBlMWFiZDkwODk5NTUxZDdlMmRjYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.EnmIlgwmxiX_pJtEAAtFVuj72Xj2H20h0CcnWLL34fw"> Did you try to continue your chat with Official OpenAI Codex extension? You might continue to your chat without issue with this extension. I think agent Sessions views is buggy at the moment. <img alt="Image" width="600" height="178" src="https://private-user-images.githubusercontent.com/56631337/518359468-f0bd1763-e9fe-45cd-b04f-1b4e985fe680.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjQwOTY2OTcsIm5iZiI6MTc2NDA5NjM5NywicGF0aCI6Ii81NjYzMTMzNy81MTgzNTk0NjgtZjBiZDE3NjMtZTlmZS00NWNkLWIwNGYtMWI0ZTk4NWZlNjgwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTI1VDE4NDYzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE0ZWRlNDBjMDZmY2NjMjA2MmZhMjQxZTQ0ZGQ5MWMyZDA0ODUyZjhkYWRhMzBmZmUwOTU5Y2VhZjllNTljMGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8BRACgXzkCx-iDYKGfoewvOHfCnb-mpoolM7gsL00HA">

Yes, I tried it. As you can see in the image, Codex cannot display past tasks.

<img width="516" height="968" alt="Image" src="https://github.com/user-attachments/assets/531d7ea5-66fa-4739-8cd5-069ec533b314" />

wiegell · 7 months ago

seems to be fixed on v0.5.48

Melond0 · 7 months ago

To use Codex in VS Code, you need to have a folder opened as your workspace root (Codex can’t properly work if you only opened a single file)

So, File → Open Folder → pick your project folder (this becomes the workspace root)
And try it again, it should works

Hard-to-tell · 6 months ago
To use Codex in VS Code, you need to have a folder opened as your workspace root (Codex can’t properly work if you only opened a single file)要在 VS Code 中使用 Codex,您需要将一个文件夹打开作为工作区根目录(如果您只打开一个文件,Codex 将无法正常工作)。 So, File → Open Folder → pick your project folder (this becomes the workspace root)所以,依次点击“文件”→“打开文件夹”→选择你的项目文件夹(这将成为工作区根目录)。 And try it again, it should works再试一次,应该可以了。

thanks!!!