Skip to content

Daemon loses track of live sessions after laptop sleep / lid-close #311

@tantmd

Description

@tantmd

Summary

After closing the laptop lid and walking away for a while, hunk session list returns no sessions (or No active Hunk session from hunk session reload) even though the corresponding hunk TUI is still alive and visible in the terminal tab. Killing & relaunching the tab re-registers it. The agent CLI side of the workflow becomes unusable until then.

Repro / observations

  • Open hunk via e.g. hunk show @- in a terminal tab. hunk session list reports the session as expected.
  • Close the laptop lid (or let macOS go to sleep), walk away, come back some time later (tens of minutes / hours).
  • After wake, the TUI tab is still rendering and accepting input.
  • hunk session list returns No active Hunk sessions.
  • CLI calls (hunk session review --repo ..., hunk session comment apply ...) fail with No active session matches repoRoot ....
  • Closing the hunk tab and re-running hunk show @- brings the session back into the list.

Concrete repro (today)

# Before sleep:
$ hunk session list
<session-id>  <repo> show @-
  path: <some-checkout>
  ...
  files: 12
  comments: 7

# (closed laptop ~14:00, woke ~14:25 — ~25 min asleep)

# After wake:
$ hunk session list
No active Hunk sessions.

# But the TUI process is still alive:
$ ps aux | grep hunk
user  47754  ...  11:59AM  /opt/homebrew/Cellar/hunk/0.11.1/libexec/hunk show @-

Environment

  • hunk 0.11.1 (Homebrew, built from source)
  • macOS 26.3 (Build 25D125)
  • arm64 (Apple Silicon)
  • Terminal: ghostty

Filed by Claude Code on the reporter's behalf.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentsAgent-to-hunk communication (MCP, selections, comments)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions