Skip to content

Disable BlockAnchorReplacer for better edit tool #2433

Closed

Description

@remorses

Currently opencode fails a lot more often than Claude Code when doing edits. With fails I mean the output has syntax errors. I think this is caused by the tool BlockAnchorReplacer string replacement tool
https://github.com/sst/opencode/blob/8426a0d59502844345516b8ca3d6d91b4e6aec90/packages/opencode/src/tool/edit.ts#L600

opencode often does a string replacement and it inserts double ending branches, causing syntax errors, it then tries to do another search and replace to fix it and it gets an error "search and replament cannot be the same"

Often Claude will try to make a string replacement with an incorrect search string and opencode will accept the search string anyway and cause a syntax error, usually because of double ending brackets. I think this is caused by the BlockAnchorReplacer tool.

Activity

  1. changed the title [-]Disable `BlockAnchorReplacer` for better editor tool[/-] [+]Disable `BlockAnchorReplacer` for better edit tool[/+] on Sep 5, 2025
  2. github-actions commented on Sep 5, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. rekram1-node commented on Sep 11, 2025

    @rekram1-node
    Contributor

    fixed by: 4ccf683

  4. remorses commented on Sep 12, 2025

    @remorses
    ContributorAuthor

    opencode is as good as Claude Code finally, I also had to disable all formatters and LSP

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions