Skip to content

Conversation

@lloydchang
Copy link

@lloydchang lloydchang commented Nov 20, 2024

Related #368 #635 #674 #784 #802 #835 RooCodeInc/Roo-Code#1 RooCodeInc/Roo-Code#14 RooCodeInc/Roo-Code#21 RooCodeInc/Roo-Code#25 https://github.com/lloydchang/cline-cline-fka-saoudrizwan-claude-dev/pull/20 https://github.com/lloydchang/cline-cline-fka-saoudrizwan-claude-dev/pull/25

git cherry-pick originated from RooCodeInc/Roo-Code@3c8a9c0

Co-authored-by: John Stearns [email protected]
Co-authored-by: Matt Rubens [email protected]
Co-authored-by: hannesrudolph [email protected]
Co-authored-by: Vetrano89 [email protected]


How to use this:

gh repo clone cline/cline
cd cline
gh pr checkout 784 --repo cline/cline
npm run install:all
npm install -g @vscode/vsce
vsce package
code --install-extension claude-dev-2.1.6.vsix
code

@lloydchang
Copy link
Author

Duplicate of #674

@lloydchang lloydchang closed this Nov 20, 2024
@lloydchang
Copy link
Author

Problem:

#674 pull request requires private npm login credentials from Roo's AWS CodeArtifact.

For Example:

npm error code E401
npm error Unable to authenticate, your authentication token seems to be invalid.
npm error To correct this please try logging in again with:
npm error   npm login
npm error A complete log of this run can be found in:  /Users/username/.npm/_logs/2024-11-20T19_54_04_026Z-debug-0.log
17 silly tarball no local data for esbuild@https://roo-815250993495.d.codeartifact.us-east-1.amazonaws.com/npm/roo-dev/esbuild/-/esbuild-0.24.0.tgz. Extracting by manifest.

Solution:

I created a different pull request at #784 with a fix to undo custom and extraneous changes.

@lloydchang
Copy link
Author

Relates to #674 (review) and #674 (comment)

@KJ7LNW
Copy link

KJ7LNW commented Nov 20, 2024

+1, would like regex for which files or cmds to allow. Just add .* if you really want all.

@lloydchang
Copy link
Author

lloydchang commented Nov 20, 2024

@KJ7LNW commented at #674 (comment) and #784 (comment)

would like regex for which files or cmds to allow. Just add .* if you really want all.

and @DRieckeBWP 👍


Hi @KJ7LNW and @DRieckeBWP,

Thank you for your suggestions. I don't have the time to investigate the addition of a regex feature. Would either of you be interested in creating additional pull requests to implement your suggested regex feature?

@lloydchang lloydchang changed the title feat: add options alwaysAllowWrite and alwaysAllowExecute feat(core, shared, webview-ui): add options alwaysAllowWrite and alwaysAllowExecute Nov 20, 2024
@KJ7LNW
Copy link

KJ7LNW commented Nov 20, 2024

I do not have time at the moment but, a good first pass that minimally changes this pr would be to replace all boolean evaluations with a function evaluation.

eg: if (this.alwaysAllowWrite) becomes if (this.allowWriteToFile(filename))

Initially the function can simply return this.alwaysAllowWrite and we can expand it in the future.

The next step would be to replace constructor invocations:

this.cline = new Cline(this, apiConfiguration, customInstructions, alwaysAllowReadOnly, 
        alwaysAllowWrite, alwaysAllowExecute, task, images)

with

this.cline = new Cline(this, apiConfiguration, customInstructions, alwaysAllowReadOnly, 
        allowWriteToFileRegex[], allowExecuteRegex[], task, images)

and the regular expression arrays are built from carriage-return-separated input boxes. (I am very new to TS and my array syntax above maybe wrong, but it gets the point across.)

From there all you need to do is update the "allow" testing functions to match, and this existing PR will look very much the same with two additional input text areas and some kind of split on '\n'.

@lloydchang
Copy link
Author

lloydchang commented Nov 20, 2024

Thanks @KJ7LNW and @DRieckeBWP


When your time permits:

  • If you prefer to in-line suggestions instead of creating a new pull request, you can use the suggestion syntax here in GitHub.
  1. In-line select existing change

  2. After selection, type:

```suggestion
suggested change

For example, I used in-line suggestion syntax earlier at #784 (comment)

Adding this export seems unnecessary because Jest test case was removed in 22a6126

Suggested change

- export interface ExtensionStateContextType extends ExtensionState {
+ interface ExtensionStateContextType extends ExtensionState {

Docs:

  1. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request
  2. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request
  3. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request

@lloydchang
Copy link
Author

@KJ7LNW suggested:

this.cline = new Cline(this, apiConfiguration, customInstructions, alwaysAllowReadOnly, 
        allowWriteToFileRegex[], allowExecuteRegex[], task, images)

When you have the opportunity to investigate further, I recommend thoroughly testing your patterns—using regex for text and glob for filenames:

  • Testing regex and glob patterns can be challenging and time-consuming due to the different escape sequences used in various operating systems and shell environments.

I have found that utilizing a boolean value, such as true or false, simplifies testing and makes it easier to maintain a codebase:

  • Less code generally results in better clarity

On the other hand, I understand your desire for flexibility and security in limiting Cline's write and execution capabilities.

Meanwhile, I wouldn't be surprised if Cline maintainers intentionally decide to decline this pull request to add the options alwaysAllowWrite and alwaysAllowExecute, as a deliberate design choice:

  • Declining this pull request would ensure a human-in-the-loop process instead of towards fully autonomous AI

For liability reasons, Cline maintainers may want to include a disclaimer.

Thank you for your time!

@KJ7LNW
Copy link

KJ7LNW commented Nov 21, 2024

Good idea about using globs for file names, that is probably more intuitive than regular expressions . regular expressions are probably still best for program execution since it gives the programmer more control .

@lloydchang
Copy link
Author

@lloydchang lloydchang changed the title feat(core, shared, webview-ui): add options alwaysAllowWrite and alwaysAllowExecute feat(core, shared, webview-ui): add options alwaysAllowWrite, alwaysAllowExecute, alwaysAllowExecute and alwaysAllowBrowser Nov 27, 2024
@lloydchang
Copy link
Author

duplication after i merged @hannesrudolph changes from #802
Screenshot 2024-11-26 at 5 11 14 PM

@lloydchang
Copy link
Author

Removed duplicates and aligned the paragraphs; they now say:
Screenshot 2024-11-26 at 5 47 02 PM

@lloydchang
Copy link
Author

@lloydchang lloydchang changed the title feat(core, shared, webview-ui): add options alwaysAllowWrite, alwaysAllowExecute, alwaysAllowExecute and alwaysAllowBrowser feat(core, shared, webview-ui): add options alwaysAllowWrite, alwaysAllowExecute and alwaysAllowBrowser Nov 27, 2024
The checkbox only applies when the model supports computer use.
@lloydchang
Copy link
Author

@lloydchang
Copy link
Author

lloydchang commented Nov 28, 2024

https://github.com/lloydchang/cline-cline-fka-saoudrizwan-claude-dev/pull/20#issuecomment-2505595419

Automated Checks via GitHub Actions Passed:

  1. Ellipsis
  2. CoderRabbit
  3. ZeroPath
  4. Socket Security
  5. Snyk

ellipsis

Refactor auto-approval logic in ChatView.tsx, removing redundant flags from Cline and ClineProvider.

  • Behavior:

    • Auto-approval logic centralized in ChatView.tsx using useEffect to handle clineAsk and enableButtons states.
    • Auto-approve actions based on alwaysAllowBrowser, alwaysAllowReadOnly, alwaysAllowWrite, and alwaysAllowExecute states.
  • Code Removal:

    • Removed alwaysAllowReadOnly, alwaysAllowWrite, alwaysAllowExecute, alwaysAllowBrowser from Cline and ClineProvider.
  • UI Logic:

    • ChatView.tsx checks clineAsk and enableButtons to auto-approve actions.
    • Functions isReadOnlyToolAction and isWriteToolAction determine tool action types for auto-approval.

This description was created by Ellipsis for https://github.com/lloydchang/cline-cline-fka-saoudrizwan-claude-dev/commit/75b9aa234989d9eae88fb564388115708274e5da. It will automatically update as commits are pushed.


coderabbitai
CodeRabbit — Review completed


zeropath-ai
Security Check — Scan completed
Details


socket-security
Socket Security: Project Report Successful in 7s — Project Report: Success
Details

socket-security
Socket Security: Pull Request Alerts Successful in 5s — Pull Request #20 Alerts: Skipped
Details


security/snyk — No manifest changes detected in 2 projects
Details

mrubens and others added 3 commits November 29, 2024 11:55
Alignment should make it easier to git cherry-pick, merge, etc. various forks of Cline's codebase

In this situation:

Use
> `<br/><br/>NOTE:`
instead of
> ` ℹ️ NOTE:`

Reference: RooCodeInc/Roo-Code@8ab4a79#diff-5e117d9dbc386d8e091bc6d42429785d0f3138330c09eab8d7fb1837c91be5dfR191
@lloydchang
Copy link
Author

Note to my future self:


If / when Saoud and Cline team review my pull requests for cline/cline and if revisions are needed, I'll try the following tactic:


Ask Cline to:

write a test for the changes in [sha]

and

write a test for feedback from Saoud and Cline team: [feedback here]


… to save me the effort from trying to re-remember what I did in pull requests from a long time ago.

@lloydchang
Copy link
Author

@lloydchang lloydchang closed this Dec 13, 2024
@grokpot
Copy link

grokpot commented Dec 18, 2024

@lloydchang why are you suggesting to use RooCline instead of the changes here being merged into Cline?

@marvijo-code
Copy link

Can we at least have a whitelist of instructions so we get a fully automated experience? I get:
"The model has determined this command requires explicit approval" after a simple "npm test". I don't get the restrictions

@grokpot
Copy link

grokpot commented Dec 21, 2024

@saoudrizwan Can you please help explain:

  1. Why this PR didn't make it into Cline
  2. What RooCline is? Is it officially related?

@KJ7LNW
Copy link

KJ7LNW commented Dec 23, 2024

@grokpot, Cline now has this support in v3.x. Check it out:

image

@bramburn
Copy link

bramburn commented Jan 9, 2025

I feel that the team here don't want to merge these large edits, I'm going to go Roo cline

@bramburn
Copy link

bramburn commented Jan 9, 2025

@saoudrizwan Can you please help explain:

  1. Why this PR didn't make it into Cline
  2. What RooCline is? Is it officially related?

doesn't seem to happen theres a 100 PR and only very few document edits or minor edits made it through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants