feat(hashline): add hashline edit tool with experimental flags#13405
feat(hashline): add hashline edit tool with experimental flags#13405watzon wants to merge 3 commits intoanomalyco:devfrom
Conversation
- Add HashlineTool for line-based editing using hashline anchors - Add OPENCODE_EXPERIMENTAL_HASHLINE and OPENCODE_EXPERIMENTAL_EDIT flags - Add tool filtering in registry to conditionally enable hashline/edit tools - Add tests for hashline tool functionality and edit-family compatibility - Integrate hashline exposure in TUI session route and run command Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
I'm trying out this PR, lets see how this goes (stream of consciousness sorry) My first thought it that this shouldn't be called More edit errors than I hoped
One problem may be that the agent likes to use maybe the tool call failures tell us something: https://gist.github.com/IndianBoy42/9b87950e8845d36eea448cf318674425 is this because its minimax-2.5-free? need to try more with kimi. well kimi had no problems at all
MiniMax2.5 made a few changes: https://github.com/IndianBoy42/opencode the key one is just calling the tool |
|
I agree @IndianBoy42. Want to check out the changes? |
|
@watzon I guess this PR will not be merged as the core toolings should remain the same. Therefore this PR was merged #4956 and I created this Plugin for Opencode that needs a bit of tweaking and tuning and some benchmarks but is the way to go: https://github.com/ASidorenkoCode/openhashline |
|
It is disappointing that that plugin no longer implements hashline editing. I don't think token savings was ever the goal of that, rather just reducing the errors in the tool calls, which you no longer benchmark. I like the architecture of building it as a plugin, that was my first instinct too but it didn't seem possible |
|
There also is izzzzzi/opencode-hashline (and #13664) |
|
Hi! Author of the opencode-hashline plugin here. Just wanted to clarify a couple of points:
Details: https://github.com/izzzzzi/opencode-hashline#benchmark |



Summary
Adds an experimental hashline edit mode for line-anchored edits with stale-anchor protection, and wires it through tool selection + CLI/TUI surfaces.
edittool ID (not a separatehashlinetool), with schema switching when enabledhashlineoperations (set_line,replace_lines,insert_after,replace) and mismatch remap diagnosticsOPENCODE_EXPERIMENTAL_HASHLINE/OPENCODE_EXPERIMENTAL_EDITapply_patchflowLINE:HASH|contentwhen hashline mode is enabledall: true, no-op replace rejection)Verification
bun test test/tool/hashline-mode-selection.test.ts test/tool/hashline.test.tsbun run typecheckbun run buildSources used for hashline implementation
packages/opencode/src/tool/hashline.tspackages/opencode/src/tool/registry.tspackages/opencode/src/tool/read.tspackages/opencode/src/flag/flag.tspackages/opencode/src/cli/cmd/run.tspackages/opencode/src/cli/cmd/tui/routes/session/index.tsxpackages/opencode/test/tool/hashline.test.tspackages/opencode/test/tool/hashline-mode-selection.test.tsFixes #13393