Port upstream SDK changes: auth options, reasoning effort, user input, handlers, and hooks.#7
Merged
brunoborges merged 15 commits intomainfrom Feb 2, 2026
Merged
Conversation
… handlers, hooks Features ported from upstream copilot-sdk (87ff5510..a552ae4): 1. Authentication options (PR #237, #2fe7352): - Add githubToken and useLoggedInUser to CopilotClientOptions - Pass auth flags to CLI process on startup - Validate auth options with external server (CliUrl) 2. Reasoning effort support (PR #302, #c39a129): - Add reasoningEffort field to SessionConfig/ResumeSessionConfig - Add reasoningEffort boolean to ModelSupports - Add supportedReasoningEfforts and defaultReasoningEffort to ModelInfo 3. User input handler (PR #269, #2fa6a92): - Add UserInputRequest, UserInputResponse, UserInputHandler, UserInputInvocation - Add onUserInputRequest to SessionConfig and ResumeSessionConfig - Handle userInput.request RPC method in CopilotClient - Add registerUserInputHandler and handleUserInputRequest to CopilotSession 4. Hooks system (PR #269, #2fa6a92): - Add PreToolUseHookInput/Output, PostToolUseHookInput/Output - Add PreToolUseHandler, PostToolUseHandler functional interfaces - Add SessionHooks and HookInvocation classes - Handle hooks.invoke RPC method in CopilotClient - Add registerHooks and handleHooksInvoke to CopilotSession 5. Session config enhancements: - Add workingDirectory to SessionConfig and ResumeSessionConfig - Add disableResume to ResumeSessionConfig 6. Models caching (PR #300, #a552ae4): - Cache listModels() results to prevent rate limiting - Clear cache on disconnect
…tests - Add AskUserTest for user input handler functionality (disabled pending harness update) - Add HooksTest for pre/post tool-use hooks (disabled pending harness update) - Add auth options tests to CopilotClientTest: - testGithubTokenOptionAccepted - testUseLoggedInUserDefaultsToNull - testExplicitUseLoggedInUserFalse - testExplicitUseLoggedInUserTrueWithGithubToken - testGithubTokenWithCliUrlThrows - testUseLoggedInUserWithCliUrlThrows Note: AskUserTest and HooksTest are disabled because they require test harness updates with support for the new RPC methods (ask_user, hooks). These tests will be enabled once the harness is updated (see upstream PR #269).
Add Step 7.5 with detailed instructions for: - Checking for new/updated tests in upstream - Porting test cases to Java following existing patterns - Test file mapping table - Handling test harness compatibility issues - Unit tests vs E2E tests guidance Update checklist to include: - New/updated tests ported from upstream - Tests marked @disabled if harness doesn't support new features
…able These tests require CLI version 0.0.400+ which includes support for the ask_user tool and hooks system. The test harness uses a separate XDG_CONFIG_HOME which causes the CLI to download an older runtime version (0.0.394) that doesn't support these features. The tests are properly implemented but disabled with @disabled annotation until the CLI runtime version issue is resolved.
…TODO comment and clarify error handling
… to locate CLI in test/harness directory
…st configurations for CLI compatibility
…tory for test resources; update maven-antrun-plugin version and add necessary dependencies
…onse test due to upstream snapshot format mismatch
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.
Features ported from upstream copilot-sdk (87ff5510..a552ae4):
Authentication options (PR #237, #2fe7352):
Reasoning effort support (PR #302, #c39a129):
User input handler (PR #269, #2fa6a92):
Hooks system (PR #269, #2fa6a92):
Session config enhancements:
Models caching (PR #300, #a552ae4):
Changes Ported from Upstream (commits 87ff5510..a552ae4)