feat: add support for additional directories in session configuration - #2180
Open
DonJayamanne wants to merge 4 commits into
Open
feat: add support for additional directories in session configuration#2180DonJayamanne wants to merge 4 commits into
DonJayamanne wants to merge 4 commits into
Conversation
- 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.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds cross-SDK support for granting sessions access to additional directories during creation and resume.
Changes:
- Adds
additionalDirectoriesconfiguration 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>
Contributor
There was a problem hiding this comment.
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
Argsdocumentation. Add anadditional_directoriesentry afterworking_directoryand 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
Argssection, although the surrounding docstring documents the other session options. Add anadditional_directoriesentry afterworking_directorythat explains relative-path resolution and that callers must re-supply these paths on resume; otherwisehelp(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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (6)
python/copilot/client.py:2684
- This new public parameter is missing from
resume_session'sArgsdocumentation, while the surrounding parameters are documented. Please document that these paths grant access beyondworking_directoryand 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'sArgsdocumentation, even though the surrounding parameters are all documented. Please describe that these directories extend access beyondworking_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) andgetSkillDirectories()(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) andgetSkillDirectories()(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
marked this pull request as ready for review
July 31, 2026 06:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
additionalDirectoriesfield in various session-related configurations across SDKs (Java, Go, .NET, Node.js, Python, Rust).additionalDirectories.