Refactor askUserQuestion method to remove unused stream parameter#3925
Open
DonJayamanne wants to merge 2 commits intomainfrom
Open
Refactor askUserQuestion method to remove unused stream parameter#3925DonJayamanne wants to merge 2 commits intomainfrom
DonJayamanne wants to merge 2 commits intomainfrom
Conversation
…oss multiple files
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the askUserQuestion method signature to remove the unused stream parameter across the codebase. The refactoring simplifies the code by delegating stream management to VS Code's built-in tool invocation API (vscode.lm.invokeTool), which handles presentation through the toolInvocationToken parameter instead of requiring explicit stream passing.
Changes:
- Updated
IUserQuestionHandlerinterface to remove thestreamparameter fromaskUserQuestionmethod signature - Refactored
UserQuestionHandlerimplementation to useIToolsService.invokeTooldirectly instead of manually managing tool lifecycle withgetCopilotToolandresolveInput - Updated all call sites and test implementations to match the new signature
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/extension/agents/copilotcli/node/userInputHelpers.ts | Removed ChatResponseStream parameter from IUserQuestionHandler.askUserQuestion interface method signature |
| src/extension/chatSessions/vscode-node/askUserQuestionHandler.ts | Simplified implementation to use invokeTool API directly, removing manual tool retrieval, availability checks, and resolveInput calls |
| src/extension/agents/copilotcli/node/copilotcliSession.ts | Updated call site to pass parameters without the stream |
| src/extension/chatSessions/vscode-node/test/askUserQuestionHandler.spec.ts | Updated test helper to mock invokeTool instead of getCopilotTool, removed obsolete test cases for tool availability check and resolveInput behavior |
| src/extension/agents/copilotcli/node/test/copilotcliSession.spec.ts | Updated test stub to match new signature |
| src/extension/agents/copilotcli/node/test/copilotCliSessionService.spec.ts | Updated test stub to match new signature |
| src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts | Updated test stub to match new signature |
rebornix
approved these changes
Feb 23, 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.
Remove the unused stream parameter from the askUserQuestion method across multiple files to streamline the code and improve clarity. This change enhances the method's signature and aligns it with its actual usage.