Skip to content

feat: add support for additional directories in session configuration - #2180

Open
DonJayamanne wants to merge 7 commits into
github:mainfrom
DonJayamanne:don/nutritious-chimpanzee
Open

feat: add support for additional directories in session configuration#2180
DonJayamanne wants to merge 7 commits into
github:mainfrom
DonJayamanne:don/nutritious-chimpanzee

Conversation

@DonJayamanne

Copy link
Copy Markdown
  • Introduced additionalDirectories field in various session-related configurations across SDKs (Java, Go, .NET, Node.js, Python, Rust).
  • Updated session creation and resume methods to handle additionalDirectories.
  • Enhanced tests to verify that additional directories are correctly forwarded during session creation and resumption.
  • Updated documentation to reflect the new configuration options.

- Introduced `additionalDirectories` field in various session-related configurations across SDKs (Java, Go, .NET, Node.js, Python, Rust).
- Updated session creation and resume methods to handle `additionalDirectories`.
- Enhanced tests to verify that additional directories are correctly forwarded during session creation and resumption.
- Updated documentation to reflect the new configuration options.
Copilot AI review requested due to automatic review settings July 31, 2026 01:32
@DonJayamanne
DonJayamanne requested a review from a team as a code owner July 31, 2026 01:32
@DonJayamanne
DonJayamanne marked this pull request as draft July 31, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds cross-SDK support for granting sessions access to additional directories during creation and resume.

Changes:

  • Adds additionalDirectories configuration across six SDKs.
  • Forwards the option through JSON-RPC create and resume requests.
  • Adds serialization, forwarding, cloning tests, and compatibility documentation.
Show a summary per file
File Description
rust/src/wire.rs Adds wire fields for create and resume.
rust/src/types.rs Adds public configuration, builders, and tests.
python/test_client.py Tests request forwarding.
python/copilot/client.py Adds and serializes the new option.
nodejs/test/client.test.ts Tests create and resume forwarding.
nodejs/src/types.ts Adds the public configuration property.
nodejs/src/client.ts Forwards directories in requests.
java/src/test/java/com/github/copilot/SessionRequestBuilderTest.java Tests request construction.
java/src/test/java/com/github/copilot/ConfigCloneTest.java Tests independent list cloning.
java/src/main/java/com/github/copilot/SessionRequestBuilder.java Maps configuration into requests.
java/src/main/java/com/github/copilot/rpc/SessionConfig.java Adds create-session configuration.
java/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java Adds the resume wire property.
java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java Adds resume configuration and cloning.
java/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java Adds the create wire property.
go/types.go Adds public and wire fields.
go/client.go Forwards configuration into requests.
go/client_test.go Tests request forwarding.
dotnet/test/Unit/CloneTests.cs Tests collection cloning.
dotnet/test/Unit/ClientSessionLifetimeTests.cs Tests request serialization.
dotnet/src/Types.cs Adds the public configuration property.
dotnet/src/Client.cs Adds create and resume request serialization.
docs/troubleshooting/compatibility.md Documents feature availability and resume behavior.

Review details

  • Files reviewed: 22/22 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 31, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Comments suppressed due to low confidence (2)

python/copilot/client.py:2684

  • The resume API's new public argument is absent from its Args documentation. Add an additional_directories entry after working_directory and state that relative paths resolve against the session working directory and that the directories are not persisted, so callers know they must supply them again when resuming.
        additional_directories: list[str] | None = None,

python/copilot/client.py:2013

  • This new public argument is missing from the method's Args section, although the surrounding docstring documents the other session options. Add an additional_directories entry after working_directory that explains relative-path resolution and that callers must re-supply these paths on resume; otherwise help(CopilotClient.create_session) and generated API documentation omit the feature's key semantics.

This issue also appears on line 2684 of the same file.

        additional_directories: list[str] | None = None,
  • Files reviewed: 22/22 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

DonJayamanne and others added 2 commits July 31, 2026 12:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 31, 2026 06:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (6)

python/copilot/client.py:2684

  • This new public parameter is missing from resume_session's Args documentation, while the surrounding parameters are documented. Please document that these paths grant access beyond working_directory and that relative paths resolve against the session working directory.
        additional_directories: list[str] | None = None,

python/copilot/client.py:2013

  • This new public parameter is missing from create_session's Args documentation, even though the surrounding parameters are all documented. Please describe that these directories extend access beyond working_directory, how relative paths resolve, and that they must be supplied again on resume.

This issue also appears on line 2684 of the same file.

        additional_directories: list[str] | None = None,

java/src/main/java/com/github/copilot/rpc/SessionConfig.java:872

  • This returns the mutable backing list, unlike the other collection-valued config getters such as getAvailableTools() (lines 305-307) and getSkillDirectories() (lines 1072-1074). Return an unmodifiable view so callers cannot mutate this setting through its getter.
    public List<String> getAdditionalDirectories() {
        return additionalDirectories;
    }

java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java:822

  • This returns the mutable backing list, unlike the other collection-valued config getters such as getAvailableTools() (lines 205-207) and getSkillDirectories() (lines 1389-1391). Return an unmodifiable view to preserve the established config API behavior.
    public List<String> getAdditionalDirectories() {
        return additionalDirectories;
    }

java/src/main/java/com/github/copilot/rpc/SessionConfig.java:880

  • The public Java API omits the relative-path behavior documented by the other SDK surfaces. Without stating that relative entries resolve against the session working directory, callers can resolve or construct these paths against the wrong base.
     * Sets directories the agent may access beyond the working directory.

java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java:830

  • The public resume API should state how relative entries are interpreted. Other SDK surfaces specify that they resolve against the session working directory; omitting that detail can cause callers to pass paths based on the process directory instead.
     * Sets directories the agent may access beyond the working directory.
  • Files reviewed: 23/23 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@DonJayamanne
DonJayamanne marked this pull request as ready for review July 31, 2026 06:27
Copilot AI review requested due to automatic review settings August 3, 2026 00:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (2)

python/copilot/client.py:2031

  • Document this new public parameter in create_session's Args section. That section documents every neighboring parameter but currently jumps directly from working_directory to provider, leaving users without the relative-path and resume behavior described by the other SDK APIs.
        additional_directories: list[str] | None = None,

python/copilot/client.py:2723

  • Document this new public parameter in resume_session's Args section. The current docstring documents working_directory and then provider, so the resume API omits the important relative-path behavior for this option.
        additional_directories: list[str] | None = None,
  • Files reviewed: 23/23 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread dotnet/src/Client.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 3, 2026 00:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (6)

python/copilot/client.py:2723

  • Document this new public keyword in the resume method's Args section. Without an entry, users cannot discover that relative paths use the resumed session's working directory; the surrounding public parameters are all documented.
        additional_directories: list[str] | None = None,

python/copilot/client.py:2031

  • Document this new public keyword in the Args section, including that relative paths resolve against working_directory and must be supplied again on resume. Every neighboring session option is documented there, but additional_directories is currently absent, so generated API documentation will omit its semantics.

This issue also appears on line 2723 of the same file.

        additional_directories: list[str] | None = None,

java/src/main/java/com/github/copilot/rpc/SessionConfig.java:872

  • Return an unmodifiable view, consistent with the other list-valued config getters such as getSkillDirectories() at SessionConfig.java:1073-1075. Returning the backing list here uniquely lets callers mutate this config through its getter.
        return additionalDirectories;

java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java:822

  • Return an unmodifiable view, as the other list-valued resume config getters do (for example ResumeSessionConfig.java:1390-1392). Exposing the backing list makes this new property behave differently from the rest of this API.
        return additionalDirectories;

java/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java:506

  • Keep this list getter consistent with the request's existing directory getters, which return unmodifiable views (CreateSessionRequest.java:625-626, 635-636, and 647-648). Returning the backing list exposes mutable request state.
        return additionalDirectories;

java/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java:511

  • Keep this list getter consistent with the existing request directory getters, which return unmodifiable views (ResumeSessionRequest.java:841-842, 851-852, and 863-864). Returning the backing list exposes mutable request state.
        return additionalDirectories;
  • Files reviewed: 23/23 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@DonJayamanne
DonJayamanne enabled auto-merge August 3, 2026 03:06

@SteveSandersonMS SteveSandersonMS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the underlying runtime feature only works for newly-created sessions, not resumed ones, but that won't affect the SDK code so I'll approve here anyway.

@DonJayamanne
DonJayamanne added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@DonJayamanne

Copy link
Copy Markdown
Author

It seems like the underlying runtime feature only works for newly-created sessions, not resumed ones, but that won't affect the SDK code so I'll approve here anyway.

Hmm, it worked for me, will have a look.

Copilot AI review requested due to automatic review settings August 3, 2026 15:36
@DonJayamanne
DonJayamanne enabled auto-merge August 3, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (2)

python/copilot/client.py:2732

  • Add additional_directories to the resume method's Args documentation. The new public parameter is currently the only nearby option missing from the documented parameter list, including its working-directory-relative path semantics.
        additional_directories: list[str] | None = None,

python/copilot/client.py:2033

  • Document additional_directories in this method's Args section. Every other public parameter is described there, but this new option is omitted, so generated API documentation does not explain that relative paths resolve against the working directory or that callers must re-supply them on resume.

This issue also appears on line 2732 of the same file.

        additional_directories: list[str] | None = None,
  • Files reviewed: 23/23 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants