-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Always set remoteControlEnabled to true for cloud agents #7448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,11 +141,20 @@ export async function activate(context: vscode.ExtensionContext) { | |
try { | ||
const config = await CloudService.instance.cloudAPI.bridgeConfig() | ||
|
||
const isCloudAgent = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a comment explaining what constitutes a cloud agent for future maintainers: |
||
typeof process.env.ROO_CODE_CLOUD_TOKEN === "string" && process.env.ROO_CODE_CLOUD_TOKEN.length > 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security consideration: The current check only validates that ROO_CODE_CLOUD_TOKEN exists and has length > 0, but doesn't validate if it's actually a valid token. Could someone potentially exploit this by setting a dummy value to force remote control enabled? Consider adding token validation or documenting why this simple check is sufficient for security. |
||
|
||
cloudLogger(`[CloudService] isCloudAgent = ${isCloudAgent}, socketBridgeUrl = ${config.socketBridgeUrl}`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good improvement using cloudLogger for consistency! This will help with debugging cloud-related issues. |
||
|
||
ExtensionBridgeService.handleRemoteControlState( | ||
userInfo, | ||
contextProxy.getValue("remoteControlEnabled"), | ||
{ ...config, provider, sessionId: vscode.env.sessionId }, | ||
(message: string) => outputChannel.appendLine(message), | ||
isCloudAgent ? true : contextProxy.getValue("remoteControlEnabled"), | ||
{ | ||
...config, | ||
provider, | ||
sessionId: vscode.env.sessionId, | ||
}, | ||
cloudLogger, | ||
) | ||
} catch (error) { | ||
cloudLogger( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider extracting this cloud agent detection logic into a utility function for better reusability and testability. For example:
You could add a new function in src/utils/remoteControl.ts or a similar utility file: