Skip to content

opentui: fatal: Added line count did not match for hunk at line 23 #3839

Closed as duplicate

Description

@jad-haddad

Description

Error: Added line count did not match for hunk at line 23
    at parseHunk (../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/patch/parse.js:119:23)
    at parseIndex (../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/patch/parse.js:38:34)
    at parsePatch (../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/patch/parse.js:127:9)
    at <anonymous> (src/cli/cmd/tui/routes/session/index.tsx:387:23)
    at <anonymous> (src/cli/cmd/tui/routes/session/index.tsx:396:8)
    at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:724:3)
    at runTop (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:833:7)
    at runQueue (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:904:42)
    at completeUpdates (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:860:84)
    at runUpdates (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:850:5)
    at setStore (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/store/dist/dev.js:221:5)
    at <anonymous> (src/cli/cmd/tui/context/sync.tsx:73:13)
    at emit (../../node_modules/.bun/@solid-primitives+event-bus@1.1.2+820208fac86deffb/node_modules/@solid-primitives/event-bus/dist/eventBus.js:6:13)
    at emit (../../node_modules/.bun/@solid-primitives+event-bus@1.1.2+820208fac86deffb/node_modules/@solid-primitives/event-bus/dist/emitter.js:92:20)
    at <anonymous> (src/cli/cmd/tui/context/sdk.tsx:25:17)
    at processTicksAndRejections (native:7:39)...

OpenCode version

1.0.15

Steps to reproduce

I prompted the build agent multiple time to fix an issue, and so it did many different modifications, as I was unpleased with the end result, I started undo-ing the changed, multiple times to go back to the initial state, after about 4 undos, I got this error

Screenshot and/or share link

No response

Operating System

macOS 15.7.1

Terminal

iTerm2

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 3, 2025
  2. github-actions commented on Nov 3, 2025

    @github-actions
    Contributor

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

    All appear to be the same underlying issue with diff/patch parsing in the opentui implementation when using undo functionality after multiple modifications.

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions