Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Sep 2, 2025

queued-messages.mp4

This makes it easier to interface with the extension bridge.


Important

Move message queue to the extension host by introducing MessageQueueService and updating Task and ChatView components to handle queued messages.

  • Behavior:
    • Introduces MessageQueueService in MessageQueueService.ts to manage message queuing.
    • Updates Task class in Task.ts to use MessageQueueService for handling user messages.
    • Modifies ChatView.tsx to handle message queuing, including adding, removing, and editing queued messages.
  • Events and Messaging:
    • Adds new message types queueMessage, removeQueuedMessage, and editQueuedMessage in WebviewMessage.ts.
    • Updates ExtensionMessage.ts and WebviewMessage.ts to include QueuedMessage type.
  • Testing:
    • Updates ChatView.spec.tsx to mock QueuedMessages and test message queuing behavior.
  • Misc:
    • Increments version in package.metadata.json from 1.66.0 to 1.67.0.

This description was created by Ellipsis for d4fe861. You can customize this summary. It will automatically update as commits are pushed.

@cte cte requested review from jr and mrubens as code owners September 2, 2025 21:47
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Sep 2, 2025
@cte cte requested a review from daniel-lxs September 2, 2025 21:52
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Sep 2, 2025
}

async getStateToPostToWebview() {
async getStateToPostToWebview(): Promise<ExtensionState> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was surprised to see that we didn't have very strict type safety on getState and getStateToPostToWebview.

Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I've reviewed the changes to move the message queue to the extension host. The implementation looks good overall, but I found some issues that need attention before merging.

| "hasOpenedModeSelector"
| "version"
| "shouldShowAnnouncement"
| "hasSystemPromptOverride"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's a bit strange that getState omits certain fields and relies on getStateToPostToWebview to fill in what's missing, but this will get us on a better path to strict type safety and we can clean this up later.

cte and others added 3 commits September 2, 2025 14:54
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

Looks good, just noticed these lines

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 2, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Sep 2, 2025
}

public get queuedMessages(): QueuedMessage[] {
return this.messageQueueService.messages
Copy link

Choose a reason for hiding this comment

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

Consider returning a shallow copy of the message queue (e.g. using slice()) in the getter to avoid external mutations of the internal state.

Suggested change
return this.messageQueueService.messages
return this.messageQueueService.messages.slice()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants