Port ExitPlanMode and AutoModeSwitch handler APIs from reference implementation#181
Draft
Port ExitPlanMode and AutoModeSwitch handler APIs from reference implementation#181
Conversation
…implementation Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
|
|
||
| session.handleExitPlanModeRequest(request).thenAccept(result -> { | ||
| try { | ||
| rpc.sendResponse(Long.parseLong(requestId), result); |
| } | ||
| }).exceptionally(ex -> { | ||
| try { | ||
| rpc.sendErrorResponse(Long.parseLong(requestId), -32603, |
|
|
||
| session.handleAutoModeSwitchRequest(request).thenAccept(response -> { | ||
| try { | ||
| rpc.sendResponse(Long.parseLong(requestId), java.util.Map.of("response", response)); |
| } | ||
| }).exceptionally(ex -> { | ||
| try { | ||
| rpc.sendErrorResponse(Long.parseLong(requestId), -32603, |
| * context information about the invocation | ||
| * @return a future that resolves with the user's decision | ||
| */ | ||
| CompletableFuture<AutoModeSwitchResponse> handle(AutoModeSwitchRequest request, |
| * @return a future that resolves with the user's decision | ||
| */ | ||
| CompletableFuture<AutoModeSwitchResponse> handle(AutoModeSwitchRequest request, | ||
| AutoModeSwitchInvocation invocation); |
| * context information about the invocation | ||
| * @return a future that resolves with the user's decision | ||
| */ | ||
| CompletableFuture<ExitPlanModeResult> handle(ExitPlanModeRequest request, ExitPlanModeInvocation invocation); |
| * context information about the invocation | ||
| * @return a future that resolves with the user's decision | ||
| */ | ||
| CompletableFuture<ExitPlanModeResult> handle(ExitPlanModeRequest request, ExitPlanModeInvocation invocation); |
…om.xml CLI version, and update scripts/codegen @github/copilot version Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Sync reference implementation with 9 new commits
Port ExitPlanMode and AutoModeSwitch handler APIs from reference implementation
May 9, 2026
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.
Resolves #297
Before the change?
ExitPlanModeandAutoModeSwitchhandler APIs present in other SDK implementations, preventing hosts from responding to runtime mode-switching requests (plan exit approval, rate-limit model switching).After the change?
ExitPlanModeHandler,AutoModeSwitchHandlerwith corresponding request/result/invocation POJOs andAutoModeSwitchResponseenum (YES,YES_ALWAYS,NO)SessionConfig/ResumeSessionConfig→SessionRequestBuilder(setsrequestExitPlanMode/requestAutoModeSwitchflags) →CopilotSession(AtomicReference storage, registration, dispatch with defaults) →RpcHandlerDispatcher(exitPlanMode.request,autoModeSwitch.requestRPC methods)NO) when no handler registered, matching .NET reference@github/copilotbumped to^1.0.44-3,.lastmergeadvanced to30a76a5Commits analyzed (9): 1 ported (
671b50amode handlers), 1 synced via finish script (ac55e9acodegen version), 7 not applicable (Go/Rust/CI-only, .NET generated code, doc typos not present in Java SDK).Pull request checklist
mvn spotless:applyhas been run to format the codemvn clean verifypasses locallyDoes this introduce a breaking change?