Skip to content

Session drops from the daemon when a commented file leaves a --watch diff #1138

Description

@LandonSchropp

When a file that has comments drops out of a --watch review (for example, right after committing it), Hunk's session disappears from the daemon. The TUI keeps running and still shows the comments, but agents can no longer reach the session.

Steps to Reproduce

mkdir /tmp/hunk-drop && cd /tmp/hunk-drop && git init
printf 'one\n' > a.txt && printf 'one\n' > b.txt
git add . && git commit -m init
printf 'two\n' >> b.txt

# In another terminal, in the same directory:
hunk diff --watch

hunk session list --json    # one session
hunk session comment add --repo . --file b.txt --new-line 2 --summary "note"

git commit -am "commit b"   # b.txt leaves the diff
printf 'two\n' >> a.txt     # keep something in the diff

hunk session list --json    # {"sessions": []}
hunk session comment list --repo . --json   # hunk: protocol-validation-failed

Expected

The session stays registered, and the comment on the file that left the diff is either kept or dropped, without taking the session with it.

Actual

The session vanishes from hunk session list, and every hunk session command against the repository fails. The TUI gives no sign that anything went wrong.

Environment

  • Hunk 0.22.0 (Homebrew)
  • macOS 26

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions