Skip to content

API listener dies on a single transient accept error; CLI and live handoff unreachable while server and panes keep running #4601

Description

@beihai23

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

After the server had been running for ~8 hours, every CLI command started failing with no herdr server is running at ~/.config/herdr/herdr.sock. The server process was still alive (16 panes with shells running), the TUI client socket still worked, and the socket file herdr.sock still existed — but nothing was accepting on it (connecting gives Connection refused).

The server log shows the moment it broke (single line, then normal pane/focus/persist activity continues for hours afterwards):

2026-09-24T09:53:32.862733Z ERROR herdr::api::server: api listener accept failed err=Software caused connection abort (os error 53)

I reproduced the dead-socket state by inspecting the running process: lsof on the server PID showed no listener on herdr.sock, and a direct connect to the socket returned ECONNREFUSED, while herdr status --json reported server not_running.

Expected behavior

A single transient accept error should not permanently remove the API socket. The server should keep serving CLI commands and live handoff until it is intentionally stopped.

Reproduction

  1. Start herdr with several panes and let it run.
  2. Wait for a transient accept error to hit the API listener (in my case after ~8h of uptime; the log line above is the only signal).
  3. Run any CLI command, e.g. herdr status --json → server_not_running; herdr server live-handoff ... → server_not_running, even though the process and panes are alive.

Impact

The server becomes unreachable from the CLI while all panes keep running. Live handoff is impossible, so the only recovery is kill <server-pid>, which terminates every running pane process. I lost 5 active Claude sessions this way.

Environment

  • Herdr version: 0.9.1
  • Update channel (stable or preview): stable
  • Operating system: macOS 15 (Apple Silicon)
  • Terminal: Ghostty
  • Shell, if relevant: zsh
  • Relevant config, if any: default socket paths

Activity

  1. added
    triagedScreened; left open for investigation or maintainer judgment. Not proof of a bug or reproduction.
    bugSomething isn't working
    p1serious defect affecting a common platform, core workflow, or broadly used integration
    macosaffects macOS-specific behavior
    apipublic JSON API, events, commands, or wire protocol
    maintainer-neededrequires maintainer judgment or maintainer-only reproduction
    on Sep 25, 2026
  2. kangal-bot commented on Sep 26, 2026

    @kangal-bot
    Collaborator

    Implemented on master and queued for the next release. This is not available in a published Herdr release yet.

  3. kangal-bot commented on Sep 28, 2026

    @kangal-bot
    Collaborator

    Released on the preview channel in 2026-09-28-80c0c07250d2. This is available to preview users, but is not in a stable Herdr release yet.

  4. kangal-bot commented on Sep 29, 2026

    @kangal-bot
    Collaborator

    Released in v0.9.2.

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

    apipublic JSON API, events, commands, or wire protocolbugSomething isn't workingmacosaffects macOS-specific behaviormaintainer-neededrequires maintainer judgment or maintainer-only reproductionp1serious defect affecting a common platform, core workflow, or broadly used integrationtriagedScreened; left open for investigation or maintainer judgment. Not proof of a bug or reproduction.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions