Skip to content

chat: combine multiple pending steering messages into single request#299061

Merged
connor4312 merged 2 commits intomainfrom
connor4312/298324
Mar 3, 2026
Merged

chat: combine multiple pending steering messages into single request#299061
connor4312 merged 2 commits intomainfrom
connor4312/298324

Conversation

@connor4312
Copy link
Member

When Copilot is running a tool, sending multiple steering messages only sends
the first one. The chatbot waits indefinitely for the remaining messages.

This fix combines all consecutive pending steering messages into a single
request by:

  • Adding dequeueAllSteeringRequests() to ChatModel to dequeue all
    consecutive steering messages at the front of the queue
  • Refactoring processNextPendingRequest() to handle both steering and queued
    requests through a unified flow that:
    • Combines multiple steering message texts with \n\n separator
    • Merges attachments from all steering messages
    • Re-parses the combined text
    • Sends as a single request to the agent

Fixes #298324

(Commit message generated by Copilot)

Copilot AI review requested due to automatic review settings March 3, 2026 21:05
@connor4312 connor4312 enabled auto-merge (squash) March 3, 2026 21:05
When Copilot is running a tool, sending multiple steering messages only sends
the first one. The chatbot waits indefinitely for the remaining messages.

This fix combines all consecutive pending steering messages into a single
request by:

- Adding dequeueAllSteeringRequests() to ChatModel to dequeue all
  consecutive steering messages at the front of the queue
- Refactoring processNextPendingRequest() to handle both steering and queued
  requests through a unified flow that:
  - Combines multiple steering message texts with \n\n separator
  - Merges attachments from all steering messages
  - Re-parses the combined text
  - Sends as a single request to the agent

Fixes #298324

(Commit message generated by Copilot)
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

Fixes an issue in the chat request queue where multiple pending steering messages (queued while a tool/run is in progress) would not all be sent, causing later steering messages to remain stuck indefinitely. The PR introduces logic to dequeue and coalesce consecutive steering messages into a single outgoing request.

Changes:

  • Added ChatModel.dequeueAllSteeringRequests() to dequeue consecutive steering requests at the front of the pending queue.
  • Refactored ChatService.processNextPendingRequest() to combine multiple steering messages (text + attachments) and send them as one request.
  • Added a unit test covering the “multiple steering messages get combined” behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts Adds a test ensuring multiple queued steering messages result in a single follow-up agent invocation.
src/vs/workbench/contrib/chat/common/model/chatModel.ts Adds a helper to dequeue all consecutive steering requests from the front of the queue.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Updates pending-request processing to coalesce consecutive steering requests and resolve all queued deferreds.

You can also share your feedback on Copilot code review. Take the survey.

@connor4312 connor4312 merged commit c5d8f77 into main Mar 3, 2026
20 checks passed
@connor4312 connor4312 deleted the connor4312/298324 branch March 3, 2026 22:17
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.

all pending steering messages should be sent at once

3 participants