forked from RooCodeInc/Roo-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Cline Refactor Attempt 1 #1
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
Open
PCLogick
wants to merge
67
commits into
diarmidmackenzie:main
Choose a base branch
from
PCLogick:refactor/cline-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* changeset version bump * Updating CHANGELOG.md format * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: R00-B0T <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
* Add roadmap to CONTRIBUTING * Update locales/zh-TW/CONTRIBUTING.md Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Provide support for escaping section markers so that the model can
add or remove lines like:
=======
by escaping them in the search or replace string:
\=======
A state machine tracks apply_diff markers appear in correct sequence:
SEARCH -> SEPARATOR -> REPLACE. Prevents syntax corruption from interleaved or
malformed blocks by validating before processing matches.
If a model tries to interleave diff markers, then the state machine will
return a response to the model like this so it can correct. testing
shows that this works on Claude 3.5, 3.7 and gemini-2.0-flash-thinking:
```xml
<error_details>
ERROR: Special marker '=======' found in your diff content at line 7:
When removing merge conflict markers like '=======' from files, you MUST escape them
in your SEARCH section by prepending a backslash (\) at the beginning of the line:
CORRECT FORMAT:
<<<<<<< SEARCH
content before
\======= <-- Note the backslash here in this example
content after
=======
replacement content
>>>>>>> REPLACE
Without escaping, the system confuses your content with diff syntax markers.
You may use multiple diff blocks in a single diff request, but ANY of ONLY the following separators that occur within SEARCH or REPLACE content must be must be escaped, as follows:
\<<<<<<< SEARCH
\=======
\>>>>>>> REPLACE
</error_details>
```
Fixes: RooCodeInc#1557
Fixes: RooCodeInc#1408
Signed-off-by: Eric Wheeler <[email protected]>
When previewing system instructions, getDiffStrategy was not receiving the MULTI_SEARCH_AND_REPLACE flag, causing the instructions to show the wrong diff strategy description. Now correctly passing the flag to ensure the proper diff strategy description is shown in system instructions. Signed-off-by: Eric Wheeler <[email protected]>
Prevents attempting to apply diffs where search and replace content are identical, which would result in no changes being made. Instead, provide a helpful error message explaining why the operation was rejected. Fixes: RooCodeInc#1350 Signed-off-by: Eric Wheeler <[email protected]>
Require newlines between diff section markers (SEARCH, ======, REPLACE) to prevent content confusion when searching input contains separator markers. Error message mentions required marker newlines. Signed-off-by: Eric Wheeler <[email protected]>
Tests valid and invalid marker sequences: - validates single and multiple complete sequences - detects out-of-order markers (separator/replace before search) - detects incorrect sequence termination - validates state transitions between SEARCH/SEP/REPLACE markers Signed-off-by: Eric Wheeler <[email protected]>
Add tests that validate: - Original content with unescaped markers - Search content with escaped markers to match unescaped markers in original content - Proper validation of escaped search, separator, and replace markers in diff content - Successful application of diffs with escaped markers in search content Signed-off-by: Eric Wheeler <[email protected]>
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
…eInc#1915) When maxReadFileLine setting was set to zero, the code would attempt to read lines with a negative end index (maxReadFileLine - 1 = -1), causing the readLines function to reject the request. This change: - Checks if maxReadFileLine is greater than zero before calling readLines - Returns an empty string when maxReadFileLine is zero - Ensures content is only formatted with line numbers when it's not empty Signed-off-by: Eric Wheeler <[email protected]> Co-authored-by: Eric Wheeler <[email protected]>
…pts (RooCodeInc#1853) - Corrected error causing free models listed under openrouter to show pricing information - Updated pre-push and pre-commit scripts to work in Windows environments when pushing to branch (windows requires npm/npx to include the ".cmd" extension to recognize and compile.
* Fixes for prompts suite unit tests on windows * unixLike -> toPosix Fix naming, and re-use code that already provides this function
…lisions Fix multiple `apply_diff` issues
…c#1862) Fix maxTokens to 8096 only for compatible Anthropic models Co-authored-by: Pugazhendhi <[email protected]>
* Add Requesty OAuth flow * New 1-click onboarding flow * Requesty: Use correct default model info * When called from the onboard flow, created the default profile Glama OAuth handler changed for consistency. * Add router images * Shuffle the routers * Translate * Appease knip --------- Co-authored-by: Daniel Trugman <[email protected]>
* Tweaks to file read auto-truncate * Change to use a text input * Changeset
* changeset version bump * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]>
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
…odeInc#1939) Signed-off-by: feifei <[email protected]>
Use compact line number format matching read_file/search_files to: - Reduce token usage in AI responses - Simplify output parsing Signed-off-by: Eric Wheeler <[email protected]> Co-authored-by: Eric Wheeler <[email protected]>
…ooCodeInc#1942) * Cline events are subscribed earlier, added `taskCreated` event to API * Probably fix the ClineProvider test
…to share within a github repo (RooCodeInc#1832) * [clinerules] search clinerule in parent folders which make it easier to share common clinerules for a git repo * fix indent * Fix test --------- Co-authored-by: Ying Liu <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
fix sys prompt browser visibility
Co-authored-by: Your Name <[email protected]>
…ction (RooCodeInc#1755) * RooCodeInc#906 Add watchPaths option to McpHub for file change detection * RooCodeInc#906 Refactor file watcher management in McpHub add support multiple watchers per server. modified the setupFileWatcher method to properly handle asynchronous operations and prevent unhandled promise rejections. error handling now includes specific error messages that identify exactly where the error occurred. --------- Co-authored-by: Matt Rubens <[email protected]>
Fix Readme docs links
* update ux for text area * fix z-index * fix tests * Update .changeset/bright-trains-crash.md Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * extract off drop method per code review bot * address bot comment --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
…ooCodeInc#1957) Co-authored-by: Your Name <[email protected]>
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
… easier to share within a github repo" (RooCodeInc#1959) Revert "[clinerules] search clinerule in parent folders which make it easier …" This reverts commit 2953bae.
handle mcp image resource
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
* add new task command * Internationalize * Revert README changes * More i18n * Fix tests * Fix i18n * Missing translations --------- Co-authored-by: Matt Rubens <[email protected]>
* Code for new fetch_instructions tool * Call parameter for fetch_instructions task, not text * Additional places that fetch_instructions needs to be added. * Pass necessary objects into create MCP server code * Update snapshots to reflect changes to prompts * Fixes from testing * Move guidance on creating project modes to fetchable instructions * i18n for new prompt Translations suggested by Roo. * Missing translation * Another missing i18n update * Missing Catalan translation * Re-use content parameter on ClineSayTool * Remove space from zh-TW translation This is consistent with other translations Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * PR review - suggested changes to prompts * Slightly more conservative in terms of text pruning from default prompt * Move additional detail about mode creation into fetch_instructions instructions --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Added Gemini 2.5 Pro * Update src/shared/api.ts --------- Co-authored-by: Matt Rubens <[email protected]>
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
…nc#1980) * Remove custom mode creation option * Remove redundant code branch
docs: update contributors list [skip ci] Co-authored-by: mrubens <[email protected]>
* changeset version bump * Update package.json * Update package-lock.json * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]>
…ooCodeInc#1985) Updated value of max tokens for gemini 2.5 to correct one
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I began attempting to refactor cline in hopes to improve its functionality. 3000+ makes it very hard to understand what is going on in the logic. Since most roads lead to Cline, it makes sense.
Since its such a big class, I approached it with AI, but a phased approach. Probably best to spend more time planning the breaking out with AI than coding it. At that point, do module by module. This will allow you to test along the way and ensure the build is still working.
Hope this helps.
Best,
-Grey