-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(human-relay): add clipboard monitoring for AI responses #1490
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
Conversation
- Add automatic detection of AI responses copied from browser - Implement configurable monitoring interval (100-2000ms) - Add duplicate response detection with warning alerts - Update UI to show monitoring status and warnings - Add new configuration options in settings
|
src/api/providers/human-relay.ts
Outdated
| let clipboardInterval: NodeJS.Timeout | null = null | ||
|
|
||
| if (options?.humanRelayMonitorClipboard) { | ||
| const monitorInterval = Math.min(Math.max(100, options?.humanRelayMonitorInterval ?? 500), 2000) |
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.
Ensure unit/integration tests cover the new clipboard monitoring functionality, including duplicate response detection.
mrubens
left a comment
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.
This is cool tech, but I'm pretty unsure about the privacy implications of this. Is it just copying anything that's in the user's clipboard and sending it to the LLM without confirmation? That sounds risky to me.
|
@mrubens In simple terms, the act of sending clipboard content to the LLM is always a manual action by the user, and it is never sent automatically without user confirmation. However, it might indeed be necessary to add an explanation in the interface for the user. In detail, the overall process when the auto-paste and send feature is enabled is as follows:
The overall process does not involve automatically sending content to the LLM, and even all interactions with the LLM are fully visible to the user. If there are any concerns, it could only be that Roo automatically monitors the latest item on the user's clipboard, which might raise privacy concerns for some users. In that case, we could add a note stating, "Roo only monitors the latest item on the user's clipboard and does not send any clipboard content anywhere." Additionally, we can clarify that the code is open-source and can be reviewed by users. |
Here’s the situation I’m thinking about:
Is that what would happen, or am I misunderstanding? Overall I guess I’m just not sure if pasting the copied text is a large enough inconvenience to justify, but let me know if you disagree. |
|
Overall, I guess I'm just not sure if pasting the copied text is a large enough inconvenience to justify, but let me know if you disagree. Oh! Yes, there will be such a problem |
I see the implication this has, but considering:
When checking if the clipboard has the new web LLM response, do some sort of check to confirm its an expected response with roo syntax. (Don't responses from LLM with roo always have XML tags?) To me, it's worth the risk; I wouldn't mind full automation with the web LLM. |
…iders, allowing for more freedom to start and stop when used
|
It might be better to add a shortcut to pull the clipboard from the chat. I was using aider copy-paste for a bit and the auto-copy is actually quite cumbersome in practice. It is better to hit copy in the web chat + some shortcut to pull it into vscode. If there is no way to do global shorcut, I think copy on web chat + alt-tab + one more shortcut to pull it into the chat would be convenient enough I think. |
…f reusing RowChat
|
Hi @mrubens, |
|
@NyxJae I am concerned this PR will get us on the shit lists of companies like Anthropic. |
Hello, I think this PR complies with the vendor’s various terms of service, and I initially referred to the details outlined at https://aider.chat/docs/usage/copypaste.html#terms-of-service. Of course, if there are any concerns, I respect your perspective. Thank you for reviewing it~ |
|
Vouching my continued support for this feature! When I want to use o1 pro without paying $150in,$600out this would greatly improve the UX for me. (especially when reading a bunch of files/other repetitive actions) I understand your concern in terms of the naughty lists, but what would anthropic/others do? |
|
As per our conversation @NyxJae I am closing this. Thank you for your excellent work here and sorry we are not merging it. We really do appreciate you and your contributions. |





Context
This PR enhances the Human Relay feature by adding clipboard monitoring capabilities. Currently, users have to manually copy AI responses from web interfaces and paste them into the dialog box, which adds friction to the workflow. This enhancement aims to simplify this process by automatically detecting when the user copies an AI response, reducing the number of manual steps required during a Human Relay interaction.
Implementation
Module-level state management: Added variables to track previous responses and prompt text at the module level in human-relay.ts to maintain state between calls.
Text normalization: Implemented utility functions (normalizeText and isTextEqual) to reliably compare text content while ignoring whitespace differences.
Clipboard monitoring: Added an interval-based polling mechanism to check for clipboard changes. When a change is detected that isn't the original prompt or a previously detected response, it automatically submits the content as the AI's response.
Duplicate detection: Added logic to detect when a user accidentally copies the previous AI response instead of responding to the current prompt, showing a warning in such cases.
UI enhancements: Updated the dialog component to show monitoring status and warnings when needed.
Configuration: Added settings to enable/disable the feature and adjust the polling interval.
The implementation follows a non-intrusive approach - the original functionality remains intact, with the monitoring being an optional enhancement that users can enable.
Screenshots
How to Test
Get in Touch
Important
Enhances Human Relay with clipboard monitoring for AI responses, configurable settings, and UI updates for monitoring status and duplicate detection.
human-relay.tswith configurable intervals (100-2000ms).HumanRelayDialog.tsx.App.tsxandHumanRelayDialog.tsxto show monitoring status and warnings.humanRelayMonitorClipboardandhumanRelayMonitorIntervaloptions inapi.tsandglobalState.ts.ApiOptions.tsxto include new settings for clipboard monitoring.closeHumanRelayDialogandshowDuplicateResponseAlertmessage types inWebviewMessage.ts.This description was created by
for 9697f6f. It will automatically update as commits are pushed.