Config parity across SDKs: add largeOutput, pluginDirectories, spell out Directory#1482
Conversation
…out directory Bring the six language SDKs (.NET, Node, Python, Go, Java, Rust) into closer alignment on session-configuration surface area: - Expose `largeOutput` / `LargeToolOutputConfig` on session create and resume in every SDK so callers can configure the CLI's large tool-output handling (enabled, maxSizeBytes, outputDirectory). Wire field stays `largeOutput.outputDir` for compatibility with the runtime. - Expose `pluginDirectories` on session create and resume in every SDK, documented as an explicit opt-in that loads plugin agents and rules even when `enableConfigDiscovery` is false. Defaults to null/none, which is the safe choice for multi-tenant hosts. - Spell out `Dir` -> `Directory` in public APIs for consistency with the rest of Types.cs (e.g. SkillDirectories, InstructionDirectories): `configDir` -> `configDirectory`, `outputDir` -> `outputDirectory`. The wire JSON names (`configDir`, `outputDir`) are preserved via language-specific serializer annotations, so this is a source-only rename. - Node SDK also re-exports `ReasoningSummary` and adds `reasoningSummary` support on resume, matching what the other SDKs already had. Notes for reviewers: - `args`/`toolArgs`/`modifiedArgs` are intentionally left abbreviated, matching the wire field names and the shell/process/CLI argument idiom used elsewhere (RuntimeConnection, MCP stdio, hook inputs). - New unit tests cover serialization (wire field stays `outputDir` / `configDir`), clone semantics for the new fields, and round-trips through CreateSessionRequest / ResumeSessionConfig in every SDK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Aligns session configuration surfaces across the Rust, Python, Node.js, Go, .NET, and Java SDKs by adding missing CLI-backed options (reasoning summary, plugin directories, large tool-output handling) and standardizing public API naming for directory-related fields while preserving existing wire JSON keys.
Changes:
- Added
reasoningSummary,pluginDirectories, andlargeOutput/LargeToolOutputConfigacross create/resume (and set-model where applicable). - Renamed public API fields from
configDir/config_dirtoconfigDirectory/config_directory(wire remainsconfigDir), and introducedoutputDirectory(wire remainsoutputDir). - Added/updated unit and E2E tests in each SDK to validate wire serialization and cloning semantics.
Show a summary per file
| File | Description |
|---|---|
| rust/tests/session_test.rs | Updates Rust tests for SetModelOptions.reasoning_summary and config_directory rename. |
| rust/tests/e2e/session.rs | Updates Rust E2E to use with_config_directory. |
| rust/src/wire.rs | Adds wire fields for reasoningSummary, pluginDirectories, and largeOutput. |
| rust/src/types.rs | Adds LargeToolOutputConfig, new session config fields, and config_directory rename + builders. |
| rust/src/session.rs | Forwards reasoning_summary in session.model.switchTo. |
| python/test_client.py | Adds unit coverage for reasoning summary, plugins, and large output forwarding; updates set_model test. |
| python/e2e/test_session_e2e.py | Updates Python E2E to use config_directory. |
| python/copilot/session.py | Adds ReasoningSummary and LargeToolOutputConfig typing; forwards set_model reasoningSummary. |
| python/copilot/client.py | Adds reasoning_summary, plugin_directories, large_output to create/resume payloads and wire conversion. |
| python/copilot/init.py | Re-exports LargeToolOutputConfig and ReasoningSummary. |
| nodejs/test/e2e/session.e2e.test.ts | Updates Node E2E to use configDirectory. |
| nodejs/test/client.test.ts | Adds Node unit tests for forwarding reasoningSummary/plugins/largeOutput and setModel reasoning options. |
| nodejs/src/types.ts | Exposes ReasoningSummary, adds LargeToolOutputConfig, and renames configDir→configDirectory. |
| nodejs/src/session.ts | Adds reasoningSummary option to setModel. |
| nodejs/src/index.ts | Re-exports LargeToolOutputConfig. |
| nodejs/src/client.ts | Maps new config fields to wire payload; converts outputDirectory→outputDir for largeOutput. |
| java/src/test/java/com/github/copilot/SessionRequestBuilderTest.java | Adds Java unit tests for reasoningSummary/plugins/largeOutput mapping in request builder. |
| java/src/test/java/com/github/copilot/CopilotSessionTest.java | Updates Java E2E-style test to use setConfigDirectory. |
| java/src/test/java/com/github/copilot/ConfigCloneTest.java | Extends clone tests for new fields and configDirectory rename. |
| java/src/main/java/com/github/copilot/SessionRequestBuilder.java | Forwards new config fields and renames configDir→configDirectory in requests. |
| java/src/main/java/com/github/copilot/rpc/SessionConfig.java | Adds reasoningSummary/plugins/largeOutput and renames configDir→configDirectory with cloning updates. |
| java/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java | Adds reasoningSummary/plugins/largeOutput; renames request property to configDirectory while keeping wire configDir. |
| java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java | Adds reasoningSummary/plugins/largeOutput; renames configDir→configDirectory with cloning updates. |
| java/src/main/java/com/github/copilot/rpc/LargeToolOutputConfig.java | Introduces Java DTO for large tool-output handling with wire outputDir. |
| java/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java | Adds reasoningSummary/plugins/largeOutput; renames request property to configDirectory while keeping wire configDir. |
| java/src/main/java/com/github/copilot/CopilotSession.java | Adds setModel overload supporting reasoningSummary and forwards it to generated RPC params. |
| go/types.go | Adds LargeToolOutputConfig, new session config fields, and renames ConfigDir→ConfigDirectory. |
| go/session.go | Forwards ReasoningSummary in model switch requests. |
| go/internal/e2e/session_e2e_test.go | Updates Go E2E test to use ConfigDirectory. |
| go/client.go | Maps new fields into create/resume wire requests. |
| go/client_test.go | Adds Go JSON serialization unit tests for new fields. |
| dotnet/test/Unit/SerializationTests.cs | Adds .NET serialization tests for reasoningSummary/plugins/largeOutput. |
| dotnet/test/Unit/CloneTests.cs | Updates .NET clone tests for new fields and ConfigDirectory rename. |
| dotnet/test/E2E/SessionE2ETests.cs | Updates .NET E2E to use ConfigDirectory. |
| dotnet/test/E2E/ClientOptionsE2ETests.cs | Normalizes file header encoding (BOM removal). |
| dotnet/test/E2E/ClientE2ETests.cs | Normalizes file header encoding (BOM removal). |
| dotnet/src/Types.cs | Adds LargeToolOutputConfig, adds reasoningSummary/pluginDirectories/largeOutput, and renames ConfigDir→ConfigDirectory. |
| dotnet/src/Client.cs | Forwards new fields in create/resume internal request records and preserves wire configDir via attributes. |
Copilot's findings
- Files reviewed: 38/38 changed files
- Comments generated: 2
- python: ruff isort fix (separate aliased import) - nodejs: prettier format on test/client.test.ts - go: gofmt alignment in client_test.go and session_e2e_test.go - rust: clippy field_reassign_with_default fix in types.rs test - java: spotless:apply across 10 files (line wrap, javadoc multi-line) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Reviewer flagged that `*int` is architecture-dependent and narrower than the u64/long/Long used in the other SDKs. Switch to `*int64` (matches Java `Long` and .NET `long?`) and update the test literal cast. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency Review ✅This PR is itself a cross-SDK consistency effort, and the implementation holds up across all six language bindings:
Wire format: All SDKs preserve Rust note: Rust is not in the changed files list but was already aligned (it has No cross-SDK inconsistencies found. 🎉
|
Why
The six language SDKs (.NET, Node, Python, Go, Java, Rust) had drifted on session-configuration surface area: a couple of useful CLI options were missing from one or more SDKs, and the public names for directory-related options were inconsistent (some spelled out
Directory, others abbreviatedDir). This change brings the six SDKs back into alignment so callers see the same options no matter which language binding they reach for.What changed
New options on session create + resume in every SDK:
largeOutput/LargeToolOutputConfig— wraps the CLI's large tool-output handling (enabled,maxSizeBytes,outputDirectory). The wire field stayslargeOutput.outputDirvia per-language serializer annotations, so this is purely an SDK-surface addition.pluginDirectories— list of Open Plugins directories to load for the session. Documented as an explicit opt-in: when set, plugin agents and rules load even ifenableConfigDiscoveryis false. Defaults to null/empty, which is the safe default for multi-tenant hosts.ReasoningSummaryand acceptsreasoningSummaryon resume, matching the other SDKs which already had it.Naming consistency in public APIs:
configDir->configDirectoryandoutputDir->outputDirectoryacross all six SDKs, to match the existing spelled-out style used everywhere else (skillDirectories,instructionDirectories,workingDirectory, ...). The wire JSON names (configDir,outputDir) are preserved through[JsonPropertyName]/@JsonProperty/#[serde(rename)]/ explicit camelCase translation in each SDK, so the runtime sees exactly the same payload.What did not change
args/toolArgs/modifiedArgswere intentionally left abbreviated. The original split betweenarguments(used only where it mirrors an external standard such as the OpenAI function-call shape or the MCPPreMcpToolCallHookInput) andargs(used for shell/process/CLI argument concepts:RuntimeConnection.args,CommandContext.args,MCPStdioServerConfig.args, hooktoolArgs/modifiedArgs) is the deliberate majority pattern; theDir->Directoryanalogy did not transfer cleanly, so reverting the brief Args rename keeps the SDKs lined up with the wire format and with the rest of the codebase.Tests
Each SDK gained unit tests that:
outputDir/configDirafter the source rename.Clone()helper).Locally verified: .NET unit suite (51/51), Node unit suite (85/85), Python unit suite (77/77),
go build+go vet+ Go unit suite,cargo check --all-targets. Java is deferred to CI (no JDK on the dev box).