You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plan path validation changes when the session working directory differs from initialCwd #2813
With a custom SessionFsProvider, Plan-mode path validation changes when only the session working directory changes. The same provider-owned Plan path succeeds when the session working directory matches the client InitialWorkingDirectory, but is rejected as outside the session folder when the session uses a different working directory.
The generated SessionFsSetProviderRequest contract says that initialCwd establishes the root of the provider's virtual namespace and that the provider is authoritative for path interpretation and workspace permission validation.
The repro runs the same native create call twice. Both cases use:
InitialWorkingDirectory = {client-root}
SessionStatePath = "session-state"
target {client-root}\session-state\plan.md
the same provider implementation and backing-store rules
The only changed value is the per-session working directory.
Expected
Both cases write the Plan through the provider and succeed without invoking the host permission callback.
Actual
Session working directory
Result
Provider Plan writes
Permission callbacks
{client-root}
success; SDK readback contains the Plan
1
0
{workspace}
denied; SDK Plan remains absent
0
0
The denied result is:
`create` was blocked. Plan mode does not permit changes outside the session folder.
A scripted real agent turn produces the same result. When the directories differ, the native create and edit calls are denied before any SessionFs Plan operation or host permission callback. It also creates session-state\temp under the session working directory.
This is related to, but distinct from, #2698. The provider is already registered and authoritative; the failure is that the Plan guard changes anchors when the session working directory differs from initialCwd.
Thanks for the detailed repro. I looked through the SDK sources (dotnet/src/Types.cs, dotnet/src/Generated/Rpc.cs, and the other SDKs' initialCwd handling). The SDK only forwards InitialWorkingDirectory and SessionStatePath in sessionFs.setProvider. It doesn't validate Plan paths. The "Plan mode does not permit changes outside the session folder" check isn't in this repo. It lives in the Copilot CLI runtime, which decides where the session folder is anchored.
Your results fit a runtime bug. The Plan guard anchors the session folder to the per-session working directory and ignores the provider's initialCwd namespace. That contradicts the generated contract, which says the provider is authoritative for path interpretation. I'm labeling this bug. The fix needs to go into the CLI runtime's Plan path guard, so this likely needs to be routed to the runtime team. I could not run the .NET repro in this environment.
Generated by Bug Handler for #2813 · copilot · auto · 10.2 AIC · ⌖ 5.46 AIC · ⊞ 7.5K · ◷
Activity
github-actions commentedon Oct 6, 2026
Thanks for the detailed repro. I looked through the SDK sources (
dotnet/src/Types.cs,dotnet/src/Generated/Rpc.cs, and the other SDKs'initialCwdhandling). The SDK only forwardsInitialWorkingDirectoryandSessionStatePathinsessionFs.setProvider. It doesn't validate Plan paths. The "Plan mode does not permit changes outside the session folder" check isn't in this repo. It lives in the Copilot CLI runtime, which decides where the session folder is anchored.Your results fit a runtime bug. The Plan guard anchors the session folder to the per-session working directory and ignores the provider's
initialCwdnamespace. That contradicts the generated contract, which says the provider is authoritative for path interpretation. I'm labeling thisbug. The fix needs to go into the CLI runtime's Plan path guard, so this likely needs to be routed to the runtime team. I could not run the .NET repro in this environment.