#1138·hunk

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

Author: LandonSchroppCreated Sep 30, 2026Updated Sep 30, 2026

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

bash
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