Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Aug 11, 2025

Important

Switches from Redis to a Socket.IO bridge for task management, adding remote control features and UI updates.

  • Behavior:
    • Introduces TaskBridgeService in Task.ts to enable task subscription via Socket.IO bridge.
    • Adds enableTaskBridge option in TaskOptions and integrates it in task lifecycle methods (startTask, resumeTaskFromHistory, abortTask).
    • Implements handleRemoteControlToggle in ClineProvider.ts to manage remote control state.
  • UI:
    • Adds remote control toggle in AccountView.tsx for users with extensionBridgeEnabled.
    • Updates i18n files for multiple languages to include remote control descriptions.
  • Configuration:
    • Updates extension.ts to initialize ExtensionBridgeService and handle remote control state changes.
    • Adds remoteControlEnabled to ExtensionState in ExtensionStateContext.tsx.
  • Testing:
    • Adds tests in AccountView.spec.tsx to verify remote control toggle visibility based on user settings.

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

@cte cte requested review from jr and mrubens as code owners August 11, 2025 12:31
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 11, 2025
@cte cte changed the base branch from main to bring_back_roomote_control August 11, 2025 12:31
Copy link
Contributor

@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 and found some issues that need attention. The switch from Redis to Socket.IO bridge looks promising, but there are a few critical issues to address.

taskNumber?: number
onCreated?: (task: Task) => void
enableTaskBridge?: boolean
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Critical issue: enableTaskBridge is duplicated in the TaskOptions interface. It appears both on line 110 and line 122 (after being moved). This will cause TypeScript compilation errors. Please remove the duplicate on line 122.

// Task Bridge
taskBridgeService?: TaskBridgeService
enableTaskBridge: boolean
taskBridgeService: TaskBridgeService | null = null
Copy link
Contributor

Choose a reason for hiding this comment

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

Inconsistent null/undefined handling. The code changes taskBridgeService from undefined to null in some places but not consistently. Consider standardizing on either null or undefined throughout for clarity. TypeScript's strict null checks work better with consistent usage.

if (this.taskBridgeService) {
await this.taskBridgeService.initialize()
await this.taskBridgeService.subscribeToTask(this)
if (this.enableTaskBridge && CloudService.hasInstance()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Code duplication: This TaskBridgeService initialization logic is duplicated in resumeTaskFromHistory(). Consider extracting it to a private helper method like initializeTaskBridge() to follow DRY principles.

await this.taskBridgeService.subscribeToTask(this)
if (this.enableTaskBridge && CloudService.hasInstance()) {
if (!this.taskBridgeService) {
const bridgeConfig = await CloudService.instance.cloudAPI?.bridgeConfig()
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing error handling: If bridgeConfig() fails or returns null, there's no user-facing error handling. Consider adding a try-catch block and at least logging the error or notifying the user that remote control features may be unavailable.

* Manages ExtensionBridgeService and TaskBridgeService lifecycle
*/
public async handleRemoteControlToggle(enabled: boolean): Promise<void> {
public async handleRemoteControlToggle(enabled: boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Return type annotation removed. The method signature changed from Promise<void> to no return type. For consistency and type safety, consider keeping the explicit return type.

}

this.log(`[TaskBridgeService] Subscribed current task ${currentTask.taskId} to TaskBridge`)
} catch (error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing cleanup in error paths. If the TaskBridgeService creation succeeds but subscription fails, the service instance remains assigned but unusable. Consider setting it back to null in the catch block to ensure consistent state.

ExtensionBridgeService.handleRemoteControlState(
userInfo,
contextProxy.getValue("remoteControlEnabled"),
{ ...bridgeConfig, provider },
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional? The provider variable is used here but it's defined later in the code (line 155). This might cause a reference error. Should this be inside a callback or should the provider be passed differently?

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 11, 2025
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.

LGTM

@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 11, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 11, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 11, 2025
@mrubens mrubens merged commit 9321cef into bring_back_roomote_control Aug 11, 2025
24 of 25 checks passed
@mrubens mrubens deleted the cte/socket-io-bridge branch August 11, 2025 17:17
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Aug 11, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Preliminary Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants