Skip to content

Remove dead requestHandler from AgentHostChatSession#309932

Merged
roblourens merged 2 commits intomainfrom
roblou/remove-dead-requesthandler
Apr 14, 2026
Merged

Remove dead requestHandler from AgentHostChatSession#309932
roblourens merged 2 commits intomainfrom
roblou/remove-dead-requesthandler

Conversation

@roblourens
Copy link
Copy Markdown
Member

Remove the unused requestHandler property and _sendRequest constructor parameter from AgentHostChatSession. The real code path uses registered agent invoke()_invokeAgent()_handleTurn(), making requestHandler dead code (confirmed by an existing todo@connor4312 comment).

Changes

  • agentHostSessionHandler.ts: Removed requestHandler property, _sendRequest constructor parameter, and the dead _sendRequest callback at the createInstance call site
  • agentHostChatContribution.test.ts: Updated startTurn / startDynamicAgentTurn helpers and all call sites to invoke turns through the registered agent's invoke() method instead of calling requestHandler directly

(Written by Copilot)

Remove the unused `requestHandler` property and `_sendRequest` constructor
parameter from `AgentHostChatSession`. The real code path uses registered
agent `invoke()` → `_invokeAgent()` → `_handleTurn()`, making
`requestHandler` dead code (confirmed by an existing todo@connor4312 comment).

Update tests to invoke turns through the registered agent's `invoke()`
method instead of calling `requestHandler` directly.

(Written by Copilot)
Copilot AI review requested due to automatic review settings April 14, 2026 18:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

Screenshot Changes

Base: 5709736b Current: 055fb28d

Changed (2)

editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
agentSessionsViewer/ApprovalRowLongLabel/Dark
Before After
before after

Copy link
Copy Markdown
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 removes dead code from the Agent Host chat session implementation by deleting the unused requestHandler property and related _sendRequest constructor plumbing, and updates the associated tests to drive turns through the registered agent invoke() path (which matches the real production flow).

Changes:

  • Remove AgentHostChatSession.requestHandler and the unused _sendRequest constructor parameter/call site.
  • Update agent host session contribution tests to start turns via the registered agent’s impl.invoke() instead of session.requestHandler.
  • Extend test request helpers to allow overriding agentId and align sessionResource scheme with the chosen agent.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Removes dead requestHandler and _sendRequest plumbing from AgentHostChatSession and its instantiation.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Refactors tests/helpers to invoke turns through the registered agent implementation instead of requestHandler.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

…s in tests

Add observeTools mock and fix getValue to return an array for
chat.agentHost.clientTools, preventing the observeTools TypeError
that was causing 71 test failures in CI.
@roblourens roblourens marked this pull request as ready for review April 14, 2026 20:31
@roblourens roblourens enabled auto-merge (squash) April 14, 2026 20:32
@roblourens roblourens merged commit 72ccd93 into main Apr 14, 2026
26 checks passed
@roblourens roblourens deleted the roblou/remove-dead-requesthandler branch April 14, 2026 20:34
@vs-code-engineering vs-code-engineering Bot added this to the 1.117.0 milestone Apr 14, 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.

3 participants