Skip to content

Session heartbeat for multi-session liveness detection #27742

Closed as not planned
Closed as not planned

Description

@MaximKh

Feature has not been suggested before.

  • 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.

Activity

  1. github-actions commented on May 15, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature request titles must start with [FEATURE]: — please rename to something like: [FEATURE]: Session heartbeat for multi-session liveness detection

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on May 15, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions