Skip to content

Comments

Refactor askUserQuestion method to remove unused stream parameter#3925

Open
DonJayamanne wants to merge 2 commits intomainfrom
don/embarrassing-nightingale
Open

Refactor askUserQuestion method to remove unused stream parameter#3925
DonJayamanne wants to merge 2 commits intomainfrom
don/embarrassing-nightingale

Conversation

@DonJayamanne
Copy link
Collaborator

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.

@DonJayamanne DonJayamanne self-assigned this Feb 23, 2026
@DonJayamanne DonJayamanne marked this pull request as ready for review February 23, 2026 02:16
Copilot AI review requested due to automatic review settings February 23, 2026 02:16
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IUserQuestionHandler interface to remove the stream parameter from askUserQuestion method signature
  • Refactored UserQuestionHandler implementation to use IToolsService.invokeTool directly instead of manually managing tool lifecycle with getCopilotTool and resolveInput
  • 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

@DonJayamanne DonJayamanne added this pull request to the merge queue Feb 23, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 23, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Feb 23, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants