Skip to content

fix(session): keep sessions alive while window is suspended - #1134

Open
HackAttack wants to merge 1 commit into
modem-dev:mainfrom
HackAttack:fix/suspend-preserve-session
Open

HackAttack wants to merge 1 commit into
modem-dev:mainfrom
HackAttack:fix/suspend-preserve-session

Conversation

@HackAttack

Copy link
Copy Markdown
Contributor

Ctrl-Z stops the whole process group, so the broker heartbeats stop with it while the detached daemon keeps running. The daemon could not tell a SIGSTOPped producer from a dead one and pruned the session after the TTL, so hunk session commands failed with "No active Hunk sessions" while the window was backgrounded and again for several seconds after fg while the client re-registered.

The transport already distinguishes the two cases: a stopped process keeps its socket open, a dead one closes it and the daemon removes the session through the close event immediately. Stale pruning now consults the socket via an optional isOpen probe on the peer; a still-open transport is never pruned for silence, and probe-less peers keep the old silence-based TTL.

Ctrl-Z stops the whole process group, so the broker heartbeats stop with
it while the detached daemon keeps running. The daemon could not tell a
SIGSTOPped producer from a dead one and pruned the session after the
TTL, so `hunk session` commands failed with "No active Hunk sessions"
while the window was backgrounded and again for several seconds after
`fg` while the client re-registered.

The transport already distinguishes the two cases: a stopped process
keeps its socket open, a dead one closes it and the daemon removes the
session through the close event immediately. Stale pruning now consults
the socket via an optional `isOpen` probe on the peer; a still-open
transport is never pruned for silence, and probe-less peers keep the old
silence-based TTL.
@greptile-apps

greptile-apps Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Sep 30, 2026

Copy link
Copy Markdown

@HackAttack is attempting to deploy a commit to the Modem Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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