Skip to content

Config parity across SDKs: add largeOutput, pluginDirectories, spell out Directory#1482

Merged
stephentoub merged 3 commits into
mainfrom
stephentoub/config-parity-audit
May 28, 2026
Merged

Config parity across SDKs: add largeOutput, pluginDirectories, spell out Directory#1482
stephentoub merged 3 commits into
mainfrom
stephentoub/config-parity-audit

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

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 abbreviated Dir). 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 stays largeOutput.outputDir via 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 if enableConfigDiscovery is false. Defaults to null/empty, which is the safe default for multi-tenant hosts.
  • Node SDK additionally re-exports ReasoningSummary and accepts reasoningSummary on resume, matching the other SDKs which already had it.

Naming consistency in public APIs:

  • configDir -> configDirectory and outputDir -> outputDirectory across 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 / modifiedArgs were intentionally left abbreviated. The original split between arguments (used only where it mirrors an external standard such as the OpenAI function-call shape or the MCP PreMcpToolCallHookInput) and args (used for shell/process/CLI argument concepts: RuntimeConnection.args, CommandContext.args, MCPStdioServerConfig.args, hook toolArgs/modifiedArgs) is the deliberate majority pattern; the Dir -> Directory analogy 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:

  1. Verify the wire field stays outputDir / configDir after the source rename.
  2. Round-trip the new fields through CreateSessionRequest / ResumeSessionConfig.
  3. Cover clone semantics for the new fields (where the SDK exposes a 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).

…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>
Copilot AI review requested due to automatic review settings May 28, 2026 17:14
@stephentoub stephentoub requested a review from a team as a code owner May 28, 2026 17:14
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, and largeOutput/LargeToolOutputConfig across create/resume (and set-model where applicable).
  • Renamed public API fields from configDir/config_dir to configDirectory/config_directory (wire remains configDir), and introduced outputDirectory (wire remains outputDir).
  • 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 configDirconfigDirectory.
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 outputDirectoryoutputDir 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 ConfigDirConfigDirectory.
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 ConfigDirConfigDirectory.
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

Comment thread go/types.go Outdated
Comment thread go/internal/e2e/session_e2e_test.go
- 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>
@github-actions

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>
@github-actions
Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR is itself a cross-SDK consistency effort, and the implementation holds up across all six language bindings:

Feature .NET Node Python Go Java Rust
largeOutput / LargeToolOutputConfig ✅ (pre-existing)
pluginDirectories ✅ (pre-existing)
configDirectory (renamed from configDir) ✅ (pre-existing)
outputDirectory (renamed from outputDir) ✅ (pre-existing)
reasoningSummary on resume ✅ (re-export added)

Wire format: All SDKs preserve configDir / outputDir / largeOutput.outputDir as the JSON wire names via per-language serializer annotations — verified across the changed files.

Rust note: Rust is not in the changed files list but was already aligned (it has config_directory, output_directory, plugin_directories, and large_output with correct serde(rename) annotations). No action needed there.

No cross-SDK inconsistencies found. 🎉

Generated by SDK Consistency Review Agent for issue #1482 · ● 2.6M ·

@stephentoub stephentoub merged commit 6ffb9e1 into main May 28, 2026
43 checks passed
@stephentoub stephentoub deleted the stephentoub/config-parity-audit branch May 28, 2026 18:14
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