[SDK] Expose Ask User Variant Session Option - #2432
Conversation
This comment has been minimized.
This comment has been minimized.
819dc05 to
702aaad
比较
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 5
新建议题s introduced by this change (5)
| Severity | Finding |
|---|---|
rust/src/types.rs — Introducing the elicitation-backed variant makes the existing public rustdoc contradictory:… |
|
go/types.go — The adjacent OnUserInputRequest comment still says that this handler enables ask_user… |
|
python/README.md — The preceding on_user_input_request entry now overstates that it enables ask_user; for the new… |
|
dotnet/README.md — The preceding OnUserInputRequest entry now claims that it enables ask_user regardless of the… |
|
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
OnUserInputRequestcomment still says that it enablesask_userunconditionally. UnderAskUserVariantElicitation, requests are delivered toOnElicitationRequestinstead, 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.
This comment has been minimized.
This comment has been minimized.
2a45198 to
c8e4437
比较
This comment has been minimized.
This comment has been minimized.
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>
c8e4437 to
5c44dda
比较
✅ Cross-SDK Consistency Review — PR #2432Feature: Selectable All six SDK implementations are consistently updated in this PR:
API semantics are consistent across all SDKs:
Input validation is present in Go (explicit validation function) and Python (ValueError check). Other SDKs rely on the type system to enforce valid values — this is appropriate for each language's idioms. No cross-SDK consistency issues found. 🎉
|

What
Adds typed
askUserVariantcreate 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
mainafter #2430 merged.