Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Apr 10, 2025

Context

We're seeing a lot of errors applying diffs in the Gemini models. When we look closely, a lot of them are related to not stripping line numbers correctly in the search and replace blocks.

Implementation

What this change does is add another more aggressive second pass if we fail to apply a diff with the standard approach. This second pass will more aggressively strip leading pipes+spaces from both search and replace, even if there's not a line number before it or not every line has a line number.


Important

Add aggressive line number stripping fallback in applyDiff() to handle inconsistent line numbers in diffs.

  • Behavior:
    • Adds aggressive line number stripping fallback in applyDiff() in multi-search-replace.ts.
    • Handles cases where line numbers are inconsistent or missing in diffs.
  • Functions:
    • Updates stripLineNumbers() in extract-text.ts to support aggressive mode for line number stripping.
  • Tests:
    • Adds tests for aggressive line number stripping in multi-search-replace.test.ts and extract-text.test.ts.
    • Removes a test that expected failure when not all lines had numbers in multi-search-replace.test.ts.

This description was created by Ellipsis for 112a1a0. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Apr 10, 2025

⚠️ No Changeset found

Latest commit: 112a1a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 10, 2025
@dosubot dosubot bot added lgtm This PR has been approved by a maintainer bug Something isn't working labels Apr 10, 2025
@mrubens mrubens merged commit c18e25f into main Apr 10, 2025
21 checks passed
@mrubens mrubens deleted the fall_back_on_aggressive_line_number_stripping_in_diffs branch April 10, 2025 04:29
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 10, 2025
ouob-tw added a commit to ouob-tw/BigFont-Roo-Code that referenced this pull request May 6, 2025
fix: update ChatRowContent(user msg in chat windows) background and font size for better styling

Add o1-pro to api.ts (RooCodeInc#2433)

Add the o1-pro model to the openai section. Sourced model info from: https://platform.openai.com/docs/models/o1-pro

Update contributors list (RooCodeInc#2411)

docs: update contributors list [skip ci]

Co-authored-by: mrubens <[email protected]>

Add custom instructions for de (RooCodeInc#2383)

v3.11.11 (RooCodeInc#2435)

API fixes (RooCodeInc#2438)

Changeset version bump (RooCodeInc#2436)

* 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]>

More sane evals default concurrency + staggered startup (RooCodeInc#2441)

Fix gh fork command (RooCodeInc#2442)

Add a script to copy eval run results to Turso (RooCodeInc#2452)

Fall back on aggressive line number stripping in diffs (RooCodeInc#2453)

* Add option for aggressive line number stripping

* Fall back on aggressive line number stripping in diffs

Make Grok3 streaming work with OpenAI Compatible (RooCodeInc#2449)

Update contributors list (RooCodeInc#2434)

docs: update contributors list [skip ci]

Co-authored-by: mrubens <[email protected]>

v3.11.12 (RooCodeInc#2454)

Changeset version bump (RooCodeInc#2455)

* changeset version bump

* Updating CHANGELOG.md format

* 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]>
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
* manual port

* successfully open remote chrome

* clean up auto-detect vs specified path

* move the browser settings into regular settings

* changeset & prettier

* correct chrome path description, remove some old comments, and rename headless mode to local mode

* rename incorrect headless mode to 'local mode'

* Sub-PR of hugelung/remote_browser: clicking browser widget's gear opens basic settings & scrolls down with a highlight (RooCodeInc#2439)

* first version of scrolling to browser settings

* really nice generic scroll to settings & highlight

* formatting & changeset

---------

Co-authored-by: Andrei Edell <[email protected]>

* added feature to detect and display chrome path as placeholder in browser settings (RooCodeInc#2442)

Co-authored-by: Andrei Edell <[email protected]>

* Features to relaunch browser in debug, test connection (RooCodeInc#2440)

* Features to Relaunch browser in debug, test connection

* Update src/services/browser/BrowserSession.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Update webview-ui/src/components/browser/BrowserSettingsMenu.tsx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: Andrei Edell <[email protected]>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* fix a merge conflict resolution error

* fix linter issue

* clarify settings descriptions

* Remove sketchy network scanning code

* respect viewport size in remote host

* headless browser fix (RooCodeInc#2451)

* Disable notifications in browser

* start of info panel popover (RooCodeInc#2453)

* start of info panel popover

* remove duplicated message & prettier fix

* Revert "remove duplicated message & prettier fix"

This reverts commit dcefef35aacfc9d9a8461d37805c2ffb64b558c4.

* info styling, close browser tab, hide headless info

---------

Co-authored-by: Andrei Edell <[email protected]>

* remove headless checkbox

* settings layout rework & more auto

* new chrome flags experiments

* make headless choice automatic & phrasing & visual cleanups

* auto-recheck chrome connection every second

- while we are looking at settings
- while we have remote debugging enabled

* continuous remote connection testing & ux cleanup

* remove advanced settings from package.json

* format fixes

* dont display connection type after dc to smooth over ui of reloading tasks

* seems we need package-lock now for ci

* Revert "remove advanced settings from package.json"

This reverts commit 5defe4a8cae7631bcf9c1fb9efa874e3238c5034.

* relaunch correctly with default session

* prevent about:blank opening on relaunch

* Resolve merge conflicts with refactor

* add browser tool telemetry

* try launching chrome using node spawn_child to detach it

* browser settings update

* do async dispose for browsersession

* remove duplicated message implementation

* Remove remote browser settings from configuration, and enhance browser settings UI with an advanced settings button.

* Remove updateBrowserSettings

* Fix text with chrome path

* fix arafat's pr note about multiple timers

* fix saoud's note about require use

* Remote browser logging (RooCodeInc#2682)

* logging

* reduce logging levels

---------

Co-authored-by: Andrei Edell <[email protected]>

* Make browser status popup adapt to viewport width

* remove requires for exec/spawn

* remove unneeded comments

* error telemetry

* remove headless mode / settings everywhere

* migrate values list to simple endpoint string

* fix log spam and clean up a comment

* Fixes; copy

* Remove local state since we're already using extension state

* Remove unnecessary remoteBrowserHost and remoteBrowserEnabled states

* Fix status wrapping

---------

Co-authored-by: Andrei Edell <[email protected]>
Co-authored-by: canvrno <[email protected]>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: canvrno <[email protected]>
Co-authored-by: Saoud Rizwan <[email protected]>
Co-authored-by: frostbournesb <[email protected]>
Co-authored-by: Dennis Bartlett <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants