Skip to content

vscode extension does not handle multiple workspace folders #8815

@jchia

Description

@jchia

What version of Codex is running?

0.77.0

What subscription do you have?

Plus

Which model were you using?

GPT-5.2-Codex

What platform is your computer?

Linux 6.8.0-90-generic x86_64 x86_64

What issue are you seeing?

The vscode extension handles wrongly the situation where the workspace has multiple folders. It presents only one folder in writable_roots given to codex, apparently the first one.

What steps can reproduce the bug?

To repro:

  • start from a test directory, e.g. ~/dm
  • mkdir x y z
  • create a xyz.code-workspace with the following content
{
	"folders": [
		{
			"path": "y"
		},
		{
			"path": "x"
		},
		{
			"path": "z"
		}
	],
	"settings": {}
}
  • code xyz.code-workspace to start vscode
  • in a new codex extension chat session in vscode ("Ask Codex to do anything"), ask "What workspace folder(s) do you see? What is writable_roots?"
  • observe the response that it can see only the y directory, and that writable_roots is only the y directory. similar things can be observed in the codex session log

Notably, y is the first listed folder in the .code-workspace file, not the lexicographically smallest one. Perhaps the extension is erroneously picking out only the first folder in the .code-workspace file.

What is the expected behavior?

Codex should respond that it can see all 3 workspace folders (x, y, z) and that writable_roots includes all 3 folders, and the codex session log should show the same thing about the writable_roots given to codex.

However, I'm not sure about conventions or expectations in codex regarding the current working directory.

Additional information

With this bug, the codex sandbox can access only y but not x & z. It should be able to access x & z also.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to the VS Code extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions