Skip to content

[SDK] Expose Ask User Variant Session Option - #2432

Open
MRayermannMSFT wants to merge 3 commits into
mainfrom
mrayermannmsft-sdk-ask-user-variant
Open

[SDK] Expose Ask User Variant Session Option#2432
MRayermannMSFT wants to merge 3 commits into
mainfrom
mrayermannmsft-sdk-ask-user-variant

Conversation

@MRayermannMSFT

@MRayermannMSFT MRayermannMSFT commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

Adds typed askUserVariant create and cold-resume options across Node, Python, Go, .NET, Rust, and Java. Omission preserves legacy behavior, while Node E2E coverage verifies the structured tool schema.

Why

github/copilot-agent-runtime#15446 added structured ask-user selection, but SDK clients could not request it. This PR was stacked on #2430 for the stable 1.0.81 runtime update and is now rebased directly onto main after #2430 merged.

@github-actions

This comment has been minimized.

Base automatically changed from update-copilot-1.0.81 to main August 27, 2026 23:09
@MRayermannMSFT
MRayermannMSFT force-pushed the mrayermannmsft-sdk-ask-user-variant branch from 819dc05 to 702aaad Compare August 27, 2026 23:13
@github-actions

This comment has been minimized.

@MRayermannMSFT
MRayermannMSFT marked this pull request as ready for review August 27, 2026 23:30
@MRayermannMSFT
MRayermannMSFT requested a review from a team as a code owner August 27, 2026 23:30
Copilot AI balanced review requested due to automatic review settings August 27, 2026 23:30
@MRayermannMSFT MRayermannMSFT added the post-to-slack Post PR to reviewers Slack channel label Aug 27, 2026

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.

Copilot review overview

Review tier: Balanced
Findings: 5 Low severity

New issues introduced by this change (5)
Severity Finding
Low severity rust/​src/​types.rs — Introducing the elicitation-backed variant makes the existing public rustdoc contradictory:…
Low severity go/​types.go — The adjacent OnUserInputRequest comment still says that this handler enables ask_user
Low severity python/​README.md — The preceding on_user_input_request entry now overstates that it enables ask_user; for the new…
Low severity dotnet/​README.md — The preceding OnUserInputRequest entry now claims that it enables ask_user regardless of the…
Low severity java/​sdk/​src/​main/​java/​com/​github/​copilot/​rpc/​SessionConfig.java — This new variant makes the existing setOnUserInputRequest Javadoc at lines 919–923 inaccurate:…
What changed in this PR

Exposes the runtime’s selectable ask_user behavior across all six SDKs.

Changes:

  • Adds typed create/cold-resume options and JSON-RPC forwarding.
  • Preserves legacy behavior when omitted and adds validation/serialization tests.
  • Documents usage and verifies the structured schema through Node E2E coverage.
File Description
CHANGELOG.md Records the new session option.
dotnet/​README.md Documents .NET usage.
dotnet/​src/​Client.cs Forwards the option over RPC.
dotnet/​src/​Types.cs Defines the enum and configuration property.
dotnet/​test/​Unit/​ClientSessionLifetimeTests.cs Tests request serialization.
dotnet/​test/​Unit/​CloneTests.cs Tests configuration cloning.
go/​README.md Documents Go usage.
go/​client.go Validates and forwards the option.
go/​client_test.go Tests forwarding, omission, and validation.
go/​types.go Defines Go API and wire fields.
java/​README.md Documents Java usage.
java/​sdk/​src/​main/​java/​com/​github/​copilot/​SessionRequestBuilder.java Copies the option into requests.
java/​sdk/​src/​main/​java/​com/​github/​copilot/​rpc/​AskUserVariant.java Defines the Java enum.
java/​sdk/​src/​main/​java/​com/​github/​copilot/​rpc/​CreateSessionRequest.java Adds the create wire field.
java/​sdk/​src/​main/​java/​com/​github/​copilot/​rpc/​ResumeSessionConfig.java Exposes the resume option.
java/​sdk/​src/​main/​java/​com/​github/​copilot/​rpc/​ResumeSessionRequest.java Adds the resume wire field.
java/​sdk/​src/​main/​java/​com/​github/​copilot/​rpc/​SessionConfig.java Exposes the create option.
java/​sdk/​src/​test/​java/​com/​github/​copilot/​ConfigCloneTest.java Tests configuration cloning.
java/​sdk/​src/​test/​java/​com/​github/​copilot/​SessionRequestBuilderTest.java Tests enum and request serialization.
nodejs/​README.md Documents Node usage.
nodejs/​src/​client.ts Forwards the option over RPC.
nodejs/​src/​index.ts Exports the public type.
nodejs/​src/​types.ts Adds the shared configuration option.
nodejs/​test/​client.test.ts Tests create/resume forwarding.
nodejs/​test/​e2e/​ui_elicitation.e2e.test.ts Verifies the structured tool schema.
python/​README.md Documents Python usage.
python/​copilot/​__init__.py Exports the public type alias.
python/​copilot/​client.py Validates and forwards the option.
python/​test_client.py Tests forwarding, omission, and validation.
rust/​README.md Documents Rust usage.
rust/​src/​types.rs Defines the enum and configuration fields.
rust/​src/​wire.rs Adds create/resume wire fields.
rust/​tests/​session_test.rs Tests request forwarding.
Suppressed comments (1)

go/types.go:1936

  • The resume config's adjacent OnUserInputRequest comment still says that it enables ask_user unconditionally. Under AskUserVariantElicitation, requests are delivered to OnElicitationRequest instead, so scope this comment to the legacy variant.
	// AskUserVariant selects the model-facing shape of the ask_user tool.
	// The zero value preserves legacy behavior. AskUserVariantElicitation also
	// requires OnElicitationRequest so the host can answer structured forms.
	AskUserVariant AskUserVariant

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rust/src/types.rs
Comment thread go/types.go Outdated
Comment thread python/README.md Outdated
Comment thread dotnet/README.md Outdated
Comment thread java/sdk/src/main/java/com/github/copilot/rpc/SessionConfig.java
@github-actions

This comment has been minimized.

@MRayermannMSFT
MRayermannMSFT force-pushed the mrayermannmsft-sdk-ask-user-variant branch from 2a45198 to c8e4437 Compare August 28, 2026 07:00
@github-actions

This comment has been minimized.

@MRayermannMSFT
MRayermannMSFT force-pushed the mrayermannmsft-sdk-ask-user-variant branch from c8e4437 to 5c44dda Compare August 29, 2026 07:00
@github-actions

This comment has been minimized.

MRayermannMSFT and others added 3 commits August 30, 2026 00:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The in-process transport does not expose current tool metadata for introspection, so keep the runtime schema assertion on the stdio cells where that RPC is supported.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MRayermannMSFT
MRayermannMSFT force-pushed the mrayermannmsft-sdk-ask-user-variant branch from 5c44dda to 47214ef Compare August 30, 2026 07:00
@github-actions

Copy link
Copy Markdown
Contributor

✅ Cross-SDK Consistency Review

This PR adds askUserVariant ("legacy" | "elicitation") to session create and cold-resume options across all six SDK implementations — Node.js, Python, Go, .NET, Java, and Rust. The feature is consistently present everywhere.

API surface summary

SDK Type Field/Param Validated
Node.js "legacy" | "elicitation" (string union) askUserVariant? on config object Type-level
Python Literal["legacy", "elicitation"] ask_user_variant= kwarg Runtime ValueError
Go AskUserVariant (typed string) AskUserVariant struct field Runtime error return
.NET AskUserVariant (enum) AskUserVariant? property Type-level
Java AskUserVariant (enum with LEGACY/ELICITATION) setAskUserVariant(...) Type-level
Rust AskUserVariant (#[non_exhaustive] enum) with_ask_user_variant(...) builder Type-level

Observations

  • Naming conventions follow each language's idiom correctly (snake_case for Python, camelCase for Node.js/Java, PascalCase for Go/.NET/Rust).
  • Wire format is consistent: serializes as lowercase "legacy" or "elicitation", and omits the field when not set (verified via tests in multiple SDKs).
  • Default behavior is preserved legacy across all SDKs when the field is omitted.
  • Go and Python add runtime validation for invalid string values, which is appropriate since those languages can't enforce the constraint at compile-time the way typed enums do.
  • Tests covering create_session and resume_session forwarding are present in all SDKs (Rust, Go, .NET, Node.js E2E, Python, Java).

No consistency issues found. 🎉

Generated by SDK Consistency Review Agent for #2432 · sonnet46 37.2 AIC · ⌖ 8.31 AIC · ⊞ 6.6K ·

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

Labels

post-to-slack Post PR to reviewers Slack channel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants