Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Oct 18, 2025

Summary

This PR addresses Issue #8721 by implementing push notifications for approval scenarios in Roo Code. Users will now receive notifications when Roo needs approval for actions like tool usage, command execution, and follow-up questions.

Changes

Core Implementation

  • Added NotificationType enum and NotificationEvent interface to packages/types/src/cloud.ts
  • Implemented CloudAPI.notifyEvent() method for backend communication
  • Created CloudService.sendNotification() with user preference validation
  • Added notification settings to UserSettingsConfig for granular control

Integration Points

  • Task.ask(): Sends notifications for tool, command, browser_action_launch, and use_mcp_server approvals
  • askFollowupQuestionTool: Triggers notifications when asking follow-up questions
  • attemptCompletionTool: Sends notifications when tasks complete

Features

  • ✅ Push notifications for approval requests
  • ✅ Push notifications for follow-up questions
  • ✅ Push notifications for task completion
  • ✅ User preference controls for each notification type
  • ✅ Non-blocking implementation (failures don't interrupt main functionality)
  • ✅ Graceful error handling with logging

Testing

  • All existing tests pass
  • Linting and type checks pass
  • Implementation follows existing CloudService patterns

Related Issue

Closes #8721

Notes

The implementation ensures that notification failures are non-blocking and won't interrupt Roo's main functionality. Users can enable/disable specific notification types through their settings configuration.

Feedback and suggestions are welcome!


Important

Adds push notifications for task-related events, including approvals, follow-up questions, and completions, with user preference controls and non-blocking error handling.

  • Behavior:
    • Adds push notifications for approval requests, follow-up questions, and task completions in Task.ts, askFollowupQuestionTool.ts, and attemptCompletionTool.ts.
    • Notifications are non-blocking and log errors without interrupting main functionality.
    • User preferences in UserSettingsConfig control notification types.
  • Core Implementation:
    • Introduces NotificationType enum and NotificationEvent interface in cloud.ts.
    • Implements CloudAPI.notifyEvent() in CloudAPI.ts for backend communication.
    • Adds CloudService.sendNotification() in CloudService.ts with user preference validation.
  • Integration Points:
    • Task.ask(): Sends notifications for tool, command, browser_action_launch, and use_mcp_server approvals.
    • askFollowupQuestionTool: Triggers notifications for follow-up questions.
    • attemptCompletionTool: Sends notifications for task completions.

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

- Add NotificationType enum and NotificationEvent interface
- Implement CloudAPI.notifyEvent() for backend communication
- Add CloudService.sendNotification() with user preference validation
- Integrate notifications in Task.ask() for tool/command/browser/MCP approvals
- Add notifications in askFollowupQuestionTool for follow-up questions
- Add notifications in attemptCompletionTool for task completion
- Add user settings configuration for enabling/disabling notification types
- Ensure non-blocking notifications that don't interrupt main functionality

Addresses #8721
@roomote roomote bot requested review from cte, jr and mrubens as code owners October 18, 2025 17:19
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Oct 18, 2025
@roomote
Copy link
Author

roomote bot commented Oct 18, 2025

Review Summary

I've reviewed the pull request and found 1 issue that should be addressed:

Issues to Address

  • Inconsistency in notification metadata: Approval notifications in Task.ts don't populate userId and organizationId fields, while follow-up question notifications do. All notification types should include these fields for consistency and proper backend routing/filtering.

Overall Assessment

The implementation looks solid overall. The notification system is well-integrated with proper error handling and non-blocking behavior. Once the metadata consistency issue is addressed, this PR will be ready to merge.

Comment on lines +846 to +859
await cloudService
.sendNotification({
timestamp: Date.now(),
type: notificationType,
title: "Approval Required",
message: notificationMessage,
taskId: this.taskId,
metadata: {
askType: type,
content: text,
mode: taskMode,
isProtected,
},
})
Copy link
Author

Choose a reason for hiding this comment

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

Inconsistency in notification metadata: The approval notifications in Task.ts don't populate userId and organizationId fields, while the follow-up question notification in askFollowupQuestionTool.ts does (lines 85-94). For consistency and to ensure proper routing/filtering on the backend, all notification types should populate these fields. Consider adding:

const userInfo = CloudService.instance.getUserInfo()
// ... then in the notification object:
userId: userInfo?.id,
organizationId: userInfo?.organizationId,

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Push notifications when Roo needs approval

2 participants