Skip to content

fix(tool): write tool incorrectly suppressed when OPENCODE_EXPERIMENTAL_HASHLINE=true #222

@randomm

Description

@randomm

Problem

In packages/opencode/src/tool/registry.ts, the tools() filter has:

if (t.id === "edit" || t.id === "write") {
  return !usePatch && !Flag.OPENCODE_EXPERIMENTAL_HASHLINE
}

This suppresses BOTH the edit tool AND the write tool when OPENCODE_EXPERIMENTAL_HASHLINE=true. Only edit should be suppressed — write should remain available since hashline_edit is not a replacement for write.

Fix

Split the condition:

if (t.id === "edit") {
  return !usePatch && !Flag.OPENCODE_EXPERIMENTAL_HASHLINE
}
if (t.id === "write") {
  return !usePatch
}

Impact

Only affects users with OPENCODE_EXPERIMENTAL_HASHLINE=true (experimental feature, not on by default).

Introduced in PR #217.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions