What happened?
Environment
OS: Windows 11, domain-joined corporate machine
VS Code version: 1.132.1
Gemini Code Assist extension version: 2.95.0
Node.js (bundled): 22.19.0
Description
When opening a workspace located outside the user's profile directory (%USERPROFILE%, e.g. C:\Users<username>), Agent Mode's background process (a2a-server.mjs) crashes on startup with exit code 1. It repeatedly restarts with exponential backoff (5s, 10s, 20s, 40s, 80s...) and never recovers, producing this error each time:
Error: Workspace path is outside the allowed root directory
at setTargetDir (a2a-server.mjs:437267:13)
at createApp (a2a-server.mjs:440077:33)
at main (a2a-server.mjs:440237:30)
Preceding log lines show the check is performed by a component logged as CoderAgentExecutor:
[CoderAgentExecutor] Overriding workspace path to: c:\dev
[ERROR] [CoderAgentExecutor] Error resolving workspace path: Error: Workspace path c:\dev is outside the allowed root directory
[ERROR] [CoreAgent] Error during startup: Workspace path c:\dev is outside the allowed root directory
Steps to Reproduce
Open any project folder located outside %USERPROFILE% in VS Code (e.g. on a secondary drive such as D:\ or E:, or even a folder directly under C:\ but outside C:\Users<username>, such as C:\dev\project).
Grant Workspace Trust for the folder.
Open the Gemini Code Assist chat panel and enable Agent Mode.
Observe the repeated crash-restart cycle described above in Output > Gemini Code Assist Chat.
Expected Behavior
Agent Mode should start successfully for any trusted workspace folder, regardless of its location on disk.
Actual Behavior
Agent Mode's background process refuses to start for any workspace not located inside %USERPROFILE%. The identical project works immediately when moved inside the user profile directory (e.g. C:\Users<username>\Projects\project), and fails identically regardless of drive letter — confirmed on C:, D:, and E:, which rules out drive letter as the differentiating factor.
Troubleshooting already performed (ruling out other causes)
Confirmed Workspace Trust is granted for the folder (via "Workspaces: Manage Workspace Trust").
Confirmed no Coder or Remote Development extensions are installed.
Confirmed no CODER_AGENT_WORKSPACE_PATH or related environment variable is set at User or System level (checked both via System Properties GUI and PowerShell Get-ChildItem Env:).
Fully reset the %USERPROFILE%.gemini folder (renamed to force recreation) and re-authenticated; issue persisted.
Tested directory junctions (mklink /J) placed inside %USERPROFILE% but pointing to the real project on another drive; the agent still failed, suggesting the check resolves the real underlying path rather than the nominal opened path.
Confirmed the issue reproduces even for a folder directly on C:\ but outside the user profile (e.g. C:\dev\project), ruling out drive letter and confirming the restriction is scoped to the profile directory specifically.
The issue disappears immediately and consistently when the identical project is placed inside %USERPROFILE%.
Suspected Root Cause
Agent Mode's background process appears to compute an "allowed root directory" scoped to the user's profile folder (%USERPROFILE%) rather than the actual VS Code workspace folder, with no way to configure or expand it. This restriction does not appear to be documented anywhere in the Agent Mode documentation.
Requested Outcome
Either:
(a) Fix Agent Mode to work correctly with workspaces located outside %USERPROFILE%, or
(b) If this is an intentional restriction, document it clearly and/or surface it as a clear, non-crash-loop error message to the user (rather than an infinite restart loop), and provide a setting to configure the allowed root directory.
What did you expect to happen?
Expected Behavior
Agent Mode should start successfully for any trusted workspace folder, regardless of its location on disk.
Actual Behavior
Agent Mode's background process refuses to start for any workspace not located inside %USERPROFILE%. The identical project works immediately when moved inside the user profile directory (e.g. C:\Users<username>\Projects\project), and fails identically regardless of drive letter — confirmed on C:, D:, and E:, which rules out drive letter as the differentiating factor.
Requested Outcome
Either:
(a) Fix Agent Mode to work correctly with workspaces located outside %USERPROFILE%, or
(b) If this is an intentional restriction, document it clearly and/or surface it as a clear, non-crash-loop error message to the user (rather than an infinite restart loop), and provide a setting to configure the allowed root directory.
Client information
Client Information
Run gemini to enter the interactive CLI, then run the /about command.
> /about
# paste output here
Login information
No response
Anything else we need to know?
No response
What happened?
Environment
OS: Windows 11, domain-joined corporate machine
VS Code version: 1.132.1
Gemini Code Assist extension version: 2.95.0
Node.js (bundled): 22.19.0
Description
When opening a workspace located outside the user's profile directory (%USERPROFILE%, e.g. C:\Users<username>), Agent Mode's background process (a2a-server.mjs) crashes on startup with exit code 1. It repeatedly restarts with exponential backoff (5s, 10s, 20s, 40s, 80s...) and never recovers, producing this error each time:
Error: Workspace path is outside the allowed root directory
at setTargetDir (a2a-server.mjs:437267:13)
at createApp (a2a-server.mjs:440077:33)
at main (a2a-server.mjs:440237:30)
Preceding log lines show the check is performed by a component logged as CoderAgentExecutor:
[CoderAgentExecutor] Overriding workspace path to: c:\dev
[ERROR] [CoderAgentExecutor] Error resolving workspace path: Error: Workspace path c:\dev is outside the allowed root directory
[ERROR] [CoreAgent] Error during startup: Workspace path c:\dev is outside the allowed root directory
Steps to Reproduce
Open any project folder located outside %USERPROFILE% in VS Code (e.g. on a secondary drive such as D:\ or E:, or even a folder directly under C:\ but outside C:\Users<username>, such as C:\dev\project).
Grant Workspace Trust for the folder.
Open the Gemini Code Assist chat panel and enable Agent Mode.
Observe the repeated crash-restart cycle described above in Output > Gemini Code Assist Chat.
Expected Behavior
Agent Mode should start successfully for any trusted workspace folder, regardless of its location on disk.
Actual Behavior
Agent Mode's background process refuses to start for any workspace not located inside %USERPROFILE%. The identical project works immediately when moved inside the user profile directory (e.g. C:\Users<username>\Projects\project), and fails identically regardless of drive letter — confirmed on C:, D:, and E:, which rules out drive letter as the differentiating factor.
Troubleshooting already performed (ruling out other causes)
Confirmed Workspace Trust is granted for the folder (via "Workspaces: Manage Workspace Trust").
Confirmed no Coder or Remote Development extensions are installed.
Confirmed no CODER_AGENT_WORKSPACE_PATH or related environment variable is set at User or System level (checked both via System Properties GUI and PowerShell Get-ChildItem Env:).
Fully reset the %USERPROFILE%.gemini folder (renamed to force recreation) and re-authenticated; issue persisted.
Tested directory junctions (mklink /J) placed inside %USERPROFILE% but pointing to the real project on another drive; the agent still failed, suggesting the check resolves the real underlying path rather than the nominal opened path.
Confirmed the issue reproduces even for a folder directly on C:\ but outside the user profile (e.g. C:\dev\project), ruling out drive letter and confirming the restriction is scoped to the profile directory specifically.
The issue disappears immediately and consistently when the identical project is placed inside %USERPROFILE%.
Suspected Root Cause
Agent Mode's background process appears to compute an "allowed root directory" scoped to the user's profile folder (%USERPROFILE%) rather than the actual VS Code workspace folder, with no way to configure or expand it. This restriction does not appear to be documented anywhere in the Agent Mode documentation.
Requested Outcome
Either:
(a) Fix Agent Mode to work correctly with workspaces located outside %USERPROFILE%, or
(b) If this is an intentional restriction, document it clearly and/or surface it as a clear, non-crash-loop error message to the user (rather than an infinite restart loop), and provide a setting to configure the allowed root directory.
What did you expect to happen?
Expected Behavior
Agent Mode should start successfully for any trusted workspace folder, regardless of its location on disk.
Actual Behavior
Agent Mode's background process refuses to start for any workspace not located inside %USERPROFILE%. The identical project works immediately when moved inside the user profile directory (e.g. C:\Users<username>\Projects\project), and fails identically regardless of drive letter — confirmed on C:, D:, and E:, which rules out drive letter as the differentiating factor.
Requested Outcome
Either:
(a) Fix Agent Mode to work correctly with workspaces located outside %USERPROFILE%, or
(b) If this is an intentional restriction, document it clearly and/or surface it as a clear, non-crash-loop error message to the user (rather than an infinite restart loop), and provide a setting to configure the allowed root directory.
Client information
Client Information
Run
geminito enter the interactive CLI, then run the/aboutcommand.Login information
No response
Anything else we need to know?
No response