Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 3, 2025

This PR separates the Task Sync and Roomote Control (Remote Control) functionality into two independent settings, allowing users to have more granular control over their cloud integration.

Changes

New Settings Structure

  • Task Sync (taskSyncEnabled): Controls whether task content (messages, code, etc.) is sent to the cloud
  • Roomote Control (remoteControlEnabled): Controls whether the cloud can send instructions back to the extension
  • Roomote Control now depends on Task Sync being enabled (cannot enable Roomote Control without Task Sync)

Key Implementation Details

  1. Added new taskSyncEnabled setting to types and global settings (defaults to true for backward compatibility)
  2. Updated CloudService integration to check taskSyncEnabled before sending task messages
  3. Usage metrics (tokens, cost) are always reported regardless of these settings
  4. Updated UI with two separate toggles and clear descriptions
  5. Added informational text explaining that usage metrics are always collected

Files Modified

  • packages/types/src/cloud.ts - Added taskSyncEnabled to user settings schema
  • packages/types/src/global-settings.ts - Added taskSyncEnabled with default value
  • src/core/task/Task.ts - Check taskSyncEnabled before capturing task messages
  • src/core/webview/webviewMessageHandler.ts - Handle taskSyncEnabled message
  • src/shared/ExtensionMessage.ts - Include taskSyncEnabled in ExtensionState
  • src/shared/WebviewMessage.ts - Add taskSyncEnabled message type
  • webview-ui/src/components/cloud/CloudView.tsx - UI with two toggles
  • webview-ui/src/context/ExtensionStateContext.tsx - State management for taskSyncEnabled
  • webview-ui/src/i18n/locales/en/cloud.json - Translation strings

Testing

  • ✅ All tests pass (npm test)
  • ✅ Linting passes (npm run lint)
  • ✅ Type checking passes

Screenshots

The UI now shows two separate toggles:

  1. Task Sync - Controls task content syncing
  2. Roomote Control - Controls remote instructions (disabled when Task Sync is off)

Backward Compatibility

  • taskSyncEnabled defaults to true to maintain existing behavior
  • Existing users will see no change in functionality unless they explicitly disable Task Sync

Important

This PR separates Task Sync and Roomote Control settings, adding independent toggles and ensuring backward compatibility by defaulting Task Sync to enabled.

  • Behavior:
    • Introduces taskSyncEnabled and remoteControlEnabled settings for granular control over cloud integration.
    • remoteControlEnabled depends on taskSyncEnabled being true.
    • Usage metrics are always reported regardless of these settings.
  • Implementation:
    • Adds taskSyncEnabled to userSettingsConfigSchema in cloud.ts and globalSettingsSchema in global-settings.ts.
    • Updates Task.ts to check taskSyncEnabled before capturing task messages.
    • Modifies webviewMessageHandler.ts to handle taskSyncEnabled messages.
    • Updates ExtensionState and WebviewMessage to include taskSyncEnabled.
    • UI changes in CloudView.tsx to add toggles for Task Sync and Roomote Control.
  • Testing:
    • All tests pass (npm test).
    • Linting and type checking pass.

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

- Add new taskSyncEnabled setting to control task content syncing
- Keep remoteControlEnabled for Roomote Control functionality
- Task Sync controls whether task content is sent to cloud
- Roomote Control controls whether cloud can send instructions back
- Roomote Control now depends on Task Sync being enabled
- Usage metrics (tokens, cost) always reported regardless of settings
- Update UI with two separate toggles and clear descriptions
- Add info text explaining usage metrics are always reported
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 3, 2025 19:01
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Sep 3, 2025
Copy link
Contributor Author

@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.

Reviewed my own code. Found it surprisingly coherent for something I wrote.

const shouldCaptureMessage = message.partial !== true && CloudService.isEnabled()
// Check if we should capture the message
// Only capture if: not partial, cloud is enabled, and taskSyncEnabled is true
const state = await this.providerRef.deref()?.getState()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this intentional? We're fetching the provider state twice in quick succession (lines 612 and 649). Could we cache the state at the beginning of the method to avoid potential race conditions where providerRef.deref() might return undefined between operations?

} catch (error) {
provider.log(`Failed to update cloud settings for task sync: ${error}`)
}
await updateGlobalState("taskSyncEnabled", message.bool ?? true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error is logged but the local state is still updated even if the cloud update fails. Should we consider showing a user-facing error message or reverting the local state to maintain consistency between local and cloud settings?

setTaskSyncEnabled(newValue)
vscode.postMessage({ type: "taskSyncEnabled", bool: newValue })
// If disabling task sync, also disable remote control
if (!newValue && remoteControlEnabled) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When disabling Task Sync automatically disables Roomote Control, there's no visual feedback to inform the user that both settings were changed. Consider adding a brief toast notification or inline message to make this behavior more transparent.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 3, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Sep 4, 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 Sep 4, 2025
@brunobergher brunobergher marked this pull request as draft September 4, 2025 09:36
@brunobergher
Copy link
Collaborator

@roomote-agent Implement the PR Feeback.

@roomote
Copy link
Contributor Author

roomote bot commented Sep 4, 2025

I see the PR feedback and will implement the following fixes:

  1. Task.ts (line 612): Cache provider state to avoid duplicate fetches and potential race conditions
  2. webviewMessageHandler.ts (line 976): Add user-facing error handling when cloud update fails
  3. CloudView.tsx (line 83): Add visual feedback when Task Sync disabling also disables Roomote Control
  4. cloud.ts (line 165): Add JSDoc comments documenting the relationship between taskSyncEnabled and extensionBridgeEnabled

Working on these changes now...

@roomote
Copy link
Contributor Author

roomote bot commented Sep 4, 2025

I have successfully implemented all the requested PR feedback:

✅ Completed Fixes

  1. Task.ts (line 612): ✓ Cached provider state to avoid duplicate fetches and potential race conditions

    • Now fetches state once and reuses it within the method
  2. webviewMessageHandler.ts (line 976): ✓ Added user-facing error handling when cloud update fails

    • Shows error message to user when settings update fails
    • Only updates local state after successful cloud update
    • Reverts UI state on failure
  3. CloudView.tsx (line 83): ✓ Added visual feedback when Task Sync disabling also disables Roomote Control

    • Shows a notification banner for 5 seconds when both settings are disabled
    • Provides clear feedback about the dependency relationship
  4. cloud.ts (line 165): ✓ Added comprehensive JSDoc comments

    • Documented the purpose of taskSyncEnabled and its relationship with extensionBridgeEnabled
    • Clarified that Roomote Control requires Task Sync to be enabled
    • Noted that usage metrics are always reported regardless of these settings

📋 Testing

  • All tests pass locally (npm test)
  • Linting passes
  • Type checking passes

⚠️ Note

The PR currently has merge conflicts that need to be resolved. The changes have been pushed to the branch and are ready for review once the conflicts are resolved.

Commit: 97ca56947

@brunobergher brunobergher force-pushed the feat/separate-task-sync-roomote-control branch from 97ca569 to b6020ac Compare September 4, 2025 11:59
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Draft / In Progress] in Roo Code Roadmap Sep 4, 2025
@brunobergher
Copy link
Collaborator

@roomote-agent add the missing translations

@roomote
Copy link
Contributor Author

roomote bot commented Sep 4, 2025

Hi @brunobergher! I see your request to add the missing translations. I'm checking out the PR now to identify and add the missing translation strings. I'll update you once complete.

…ings

- Added taskSync, taskSyncDescription, remoteControlRequiresTaskSync, and usageMetricsAlwaysReported keys to all non-English cloud.json files
- Updated cloudBenefit keys to match English structure
- Ensured all languages have consistent translation keys for the new Task Sync and Roomote Control features
@roomote roomote bot force-pushed the feat/separate-task-sync-roomote-control branch from 7ee0da1 to 74c0943 Compare September 4, 2025 20:04
@roomote
Copy link
Contributor Author

roomote bot commented Sep 4, 2025

Hi @brunobergher! ✅ I've successfully added the missing translations for the Task Sync and Roomote Control settings.

Changes made:

  • Added taskSync, taskSyncDescription, remoteControlRequiresTaskSync, and usageMetricsAlwaysReported keys to all 17 non-English cloud.json files
  • Updated the cloudBenefit* keys to match the English structure (removed cloudBenefitsSubtitle and reordered benefits)
  • Ensured all languages have consistent translation keys for the new Task Sync and Roomote Control features

Files updated:

All cloud.json files in the following locales:

  • ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW

The chat.json files already had the sharingDisabledByOrganization key, so no changes were needed there.

All tests are passing locally. The PR checks are currently running and should complete shortly.

@hannesrudolph
Copy link
Collaborator

Closing this as stale. Reopen if needed

@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 16, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Sep 16, 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 PR - Draft / In Progress 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.

4 participants