Skip to content

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

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

feat: add support for additional directories in session configuration#2180
DonJayamanne wants to merge 4 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
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.

2 participants