Skip to content

A pane exit never resolves a loop the daemon knows is live or just restarted - #244

Merged
scgopi merged 4 commits into
mainfrom
fix/restart-resolution-guard
Sep 1, 2026
Merged

scgopi merged 4 commits into
mainfrom
fix/restart-resolution-guard

Conversation

@scgopi

@scgopi scgopi commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Why

After Restart All Sessions (0.1.58-beta5), restarted loops showed FAILED. There is exactly one writer of FAILED for an ordinary loop: the app's pane-exit report (nodeCheckRejected), and the daemon only guarded it for remote projects. A pane that watched a restart's kill, a retained pane of a loop switched away from, or Ghostty's own ⌘W close binding in a running pane could all resolve a loop that was still working. Nothing logged why.

What

Daemon

  • sessionPermitsResolution replaces the remote-only check. Refuses a pane exit report within 60 s of a restart (the restart's own kill), or when the local session is still alive and not a husk (ZmxSessionLauncher.isSessionAlive, the ensure's own husk-aware check). Remote keeps its presence check.
  • Every refusal and every resolution is written to the node's memory log with its cause: resolved: failed — its pane closed with the process still running, … — its workers rolled up to stalled, … — its goal predicate passed.

App

  • The loop bar's top-right button is now Restart session; Stop Loop stays in the Loop menu.
  • primarySurfaceExited logs a pane exit-finished / pane exit-alive dial line and is dropped while a remount is pending. The case moved to AppFeature+LoopSessions.swift with its siblings.

Verification

  • 1499 tests / 155 suites pass in the worktree; swiftlint 0 errors; swift format --strict clean.
  • New tests: a check right after a restart is ignored and memoed; a pane closing on a live session is refused until the session is gone, and the failure memo names the cause.

🤖 Generated with Claude Code

https://claude.ai/code/session_0199VUTtyfuWHbu2hHXpHYw2

@scgopi
scgopi merged commit 97dc705 into main Sep 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant