You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Session heartbeat for multi-session liveness detection #27759
I have verified this feature I am about to request has not been suggested before.
Describe the enhancement you want to request
OpenCode advertises multi-session ("Start multiple agents in parallel on the same project") but provides no way for sessions to detect each other. If a parallel session crashes or hangs, its resources (temp dirs, ports, files) are never released, and other sessions have no way to know.
Add two fields to the existing session table:
heartbeat_at — timestamp, written every 30s while session is alive
peer_id — unique per process, survives session restarts
Extend the existing compaction/prune to skip sessions with heartbeat_at older than 5 min as stale.
Why core: multi-session is a public feature, but without heartbeat it is unsafe. External modules (MCP, SLM) can read the DB for coordination; core just tracks liveness.
Scope: ~10 lines across 3 existing files (session/schema.ts, session/lifecycle.ts, session/compaction.ts). No new tables, no new config, no new dependencies.
This is not a duplicate — #27742 was auto-closed for title format (missing [FEATURE]: prefix). This is the corrected version with the proper title format. Please reopen #27742 or keep this one. Thank you.
this is the exact problem i ended up solving in repowire, and the heartbeat_at + peer_id shape you propose is almost the same design i landed on, so a couple of notes from running it:
keying on a stable peer_id rather than a path/name is the right call. parallel sessions on the same project collide on anything path-derived, so liveness and routing both need the id
on the heartbeat: i deliberately avoided a polling timer. instead liveness is reconciled lazily, when a request next needs the registry it runs a repair pass and evicts stale peers. nothing runs on a schedule, the work piggybacks on real requests. cheaper, and no background loop to babysit
the crashed-session-leaks-resources case is real and ghost eviction handles it well once you have the id + a reconciliation trigger. happy to share specifics if useful, this is squarely the thing the daemon does.
Activity
github-actions commentedon May 15, 2026
This issue might be a duplicate of existing issues. Please check:
MaximKh commentedon May 15, 2026
This is not a duplicate — #27742 was auto-closed for title format (missing
[FEATURE]:prefix). This is the corrected version with the proper title format. Please reopen #27742 or keep this one. Thank you.prassanna-ravishankar commentedon Jun 21, 2026
this is the exact problem i ended up solving in repowire, and the
heartbeat_at+peer_idshape you propose is almost the same design i landed on, so a couple of notes from running it:peer_idrather than a path/name is the right call. parallel sessions on the same project collide on anything path-derived, so liveness and routing both need the idthe crashed-session-leaks-resources case is real and ghost eviction handles it well once you have the id + a reconciliation trigger. happy to share specifics if useful, this is squarely the thing the daemon does.
github-actions commentedon Aug 20, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.