feat: add DeleteQueuedMessage IPC command#11464
Conversation
Reviewed all changes across all commits including the changeset removal. No issues found. The Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
ef4d631 to
f0f80f7
Compare
Reviewed all changes. No issues found. The Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| case TaskCommandName.DeleteQueuedMessage: | ||
| this.log(`[API] DeleteQueuedMessage -> ${data}`) | ||
| this.deleteQueuedMessage(data) | ||
| break |
There was a problem hiding this comment.
P2: This handler should be wrapped in try/catch like cte's other IPC command handlers (see GetCommands/GetModes/GetModels in #11279). Without it, an exception from removeMessage would propagate unhandled to the IPC server. Also, use command.data instead of data to stay consistent with the refactor in #11162.
| case TaskCommandName.DeleteQueuedMessage: | |
| this.log(`[API] DeleteQueuedMessage -> ${data}`) | |
| this.deleteQueuedMessage(data) | |
| break | |
| case TaskCommandName.DeleteQueuedMessage: | |
| this.log(`[API] DeleteQueuedMessage -> ${command.data}`) | |
| try { | |
| this.deleteQueuedMessage(command.data) | |
| } catch (error) { | |
| const errorMessage = error instanceof Error ? error.message : String(error) | |
| this.log(`[API] DeleteQueuedMessage failed for messageId ${command.data}: ${errorMessage}`) | |
| } | |
| break |
| public deleteQueuedMessage(messageId: string) { | ||
| this.sidebarProvider.getCurrentTask()?.messageQueueService.removeMessage(messageId) | ||
| } |
There was a problem hiding this comment.
P2: If getCurrentTask() returns undefined, this silently no-ops with no log trail. Splitting it out and logging the miss would help with debugging in cloud worker scenarios.
| public deleteQueuedMessage(messageId: string) { | |
| this.sidebarProvider.getCurrentTask()?.messageQueueService.removeMessage(messageId) | |
| } | |
| public deleteQueuedMessage(messageId: string) { | |
| const task = this.sidebarProvider.getCurrentTask() | |
| if (!task) { | |
| this.log(`[API] DeleteQueuedMessage: no current task, ignoring`) | |
| return | |
| } | |
| task.messageQueueService.removeMessage(messageId) | |
| } |
|
@roomote verify the review recommendations and follow them if it makes sense to |
Verified the review recommendations. The reviewer's assessment is correct: no issues found. The No code changes required. |
Related GitHub Issue
Closes: CLO-913
Roo Code Task Context (Optional)
https://app.roocode.com/cloud-jobs/2PeBJJHO?utm_source=github-comment&utm_medium=link&utm_campaign=linear.agent.session
Description
Adds a
DeleteQueuedMessagecommand to the extension's IPC protocol (TaskCommandName), enabling the cloud worker to forward queue deletion requests that actually remove messages from the extension'sMessageQueueService.Previously, the cloud/web side (Roo-Code-Cloud PR #2506) could only suppress queued messages visually via a worker-side set, but the extension would still process "deleted" messages when dequeuing. This change completes the circuit by letting the worker send a
DeleteQueuedMessageIPC command that callsMessageQueueService.removeMessage()on the extension side.Key changes:
packages/types/src/ipc.ts: AddedDeleteQueuedMessageto theTaskCommandNameenum andtaskCommandSchema(takes astringmessageId)src/extension/api.ts: Added handler for the new command in the IPC switch and a publicdeleteQueuedMessage()methodpackages/ipc/src/ipc-client.ts: AddeddeleteQueuedMessage(messageId)convenience methodTest Procedure
packages/types/src/__tests__/ipc.test.ts) and API handler (src/extension/__tests__/api-delete-queued-message.spec.ts)Pre-Submission Checklist
Documentation Updates
No documentation updates are required.
Additional Notes
The cloud worker side (Roo-Code-Cloud) can now be updated to send
TaskCommandName.DeleteQueuedMessagevia IPC instead of relying solely on the suppression-set approach, enabling true queue removal.View task on Roo Code Cloud