Skip to content

Plan path validation changes when the session working directory differs from initialCwd #2813

Description

@nicolasdossantos

Summary

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.

Versions

  • GitHub.Copilot.SDK: 1.0.17-preview.7
  • Bundled Copilot CLI: 1.0.93-1
  • OS: Windows
  • Target framework: net10.0

Minimal standalone reproduction

Run:

dotnet run

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions