Skip to content

Terminal can stay stuck reattaching after daemon/session idle #350

@Vaibhaav-Tiwari

Description

@Vaibhaav-Tiwari

Problem

The Electron UI can get stuck showing terminal reattach/disconnected state after the app/session has been idle. In the observed case, the daemon was still healthy and ready, but the renderer did not create a fresh terminal mux attach attempt, so the terminal pane stayed blank/reattaching until the app was restarted.

Evidence

  • �o status --json reported the daemon as
    eady.
  • The daemon process was running from the expected checkout.
  • Daemon logs did not show new /mux attach attempts while the UI was stuck.
  • A related failure mode is that Electron can also pick up a stale daemon from another checkout via
    unning.json, which leaves the frontend pointed at the wrong process/port.

Expected behavior

When the daemon is healthy or becomes healthy again, the frontend should recover automatically and reconnect terminal panes without requiring an Electron restart.

Suggested fix

  • Include daemon identity in health/readiness responses.
  • Have Electron reject stale/wrong daemons from another checkout.
  • Re-probe/re-adopt a compatible existing daemon when renderer asks for daemon status.
  • Refresh daemon status while the renderer is not ready, especially after idle/focus restore, so terminal reattach can resume.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions