[Bug] VS Code extension passes zero workspace roots and uses unrelated inherited working directory

Resolved 💬 1 comment Opened Jul 22, 2026 by Convincible Closed Jul 22, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the IDE extension are you using?

26.715.61943

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64"Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

New local Codex conversations are consistently attached to an unrelated repository instead of the folder open in the current VS Code window.

This happens even though VS Code's workspace state identifies other open projects.

The problem persists after:

  • Creating a new Codex conversation
  • Running Developer: Reload Window
  • Closing and reopening VS Code
  • Closing and reopening the Codex side panel

The Codex extension log shows that no runtime workspace roots are being sent when a turn starts:

requestRuntimeWorkspaceRootCount=0

The resulting Codex session then receives an unrelated project as its working directory and writable root. Later log entries confirm Git operations are also attempted using the incorrect directory:

Meanwhile, VS Code's own workspace state correctly contains the folder actually open in the window.

This suggests that the extension is failing to pass the active VS Code workspace to the Codex app server. When the runtime workspace-root list is empty, Codex appears to fall back to an inherited process working directory from a previously opened repository.

What steps can reproduce the bug?

Difficult to say what steps got Codex into this state, however:

  • I regularly switch between projects in the same VS Code window, or open new VS Code windows with different projects, each with their own Codex panel (previously this worked fine and it always understood which project it was in)
  • I have the ChatGPT app installed and make use of Codex Remote

What is the expected behavior?

Each new local Codex conversation should use the folder associated with the current VS Code window.

The active folder should be passed to the app server as a runtime workspace root.

Additional information

Extracts from logs:

2026-07-22 13:01:43.639 [info] Activating Codex extension
2026-07-22 13:01:43.640 [info] [CodexMcpConnection] Spawning codex app-server
2026-07-22 13:01:49.160 [info] Features enabled enabledFeatures="[redacted]"
2026-07-22 13:01:50.009 [info] [git-repo-watcher] Starting git repo watcher
2026-07-22 13:01:51.283 [info] Concurrent reasoning summaries thread-start config resolved featureOverride=null threadStartConfig=null
2026-07-22 13:01:54.523 [info] [git-repo-watcher] Starting git repo watcher
2026-07-22 13:01:58.107 [info] Conversation created conversationId=[redacted]
2026-07-22 13:01:58.255 [info] Reasoning summary turn-start config resolved concurrentReasoningSummariesFeatureOverrideEnabled=false conversationId=[redacted] requestApprovalPolicy=on-request requestApprovalsReviewer=auto_review requestPermissionProfile=null requestRuntimeWorkspaceRootCount=0 requestSandboxPolicyType=workspaceWrite requestSandboxWritableRootCount=1 resolvedApprovalPolicy=on-request resolvedApprovalsReviewer=auto_review summary=none useAppServerPermissionDefault=false
2026-07-22 13:02:07.198 [warning] [git] git.command.complete aborted=false command="[redacted]" cwd=[wrong_dir] durationMs=103 exitCode=128 failureReason=command_failed hostId=local requestKind=turn-diff-capture-complete source=turn_diff_analytics success=false timedOut=false
2026-07-22 13:02:07.201 [warning] worker_rpc_response_error error={} method=turn-diff-capture-complete workerId=git
2026-07-22 13:02:07.202 [warning] Failed to complete turn diff analytics capture error={} status=completed

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #34457
  • #34341

Powered by Codex Action