Skip to content

Reattach panes to live nemesis8 containers on launch (session survival, herdr answer) #133

Description

@kordless

Goal

When Hyperia launches (or restores a layout per #83), detect still-running n8-* agent containers and offer to reattach panes onto them (n8 resume <session>) instead of spawning fresh shells. The agent already survives Hyperia restarts — nemesis8 runs it detached (-d, no --rm), so the container outlives the terminal. What's missing is only the ergonomics: wiring a pane back onto the surviving agent.

Why

herdr's headline feature is 'detach, agents keep running — reattach from any terminal'. Our architecture is strictly stronger (the agent persists — runtime, filesystem, conversation — not just a PTY session), but reattach is manual today. This closes the last ergonomic gap.

Scope

  • On startup (after sidecar up), sweep docker ps for containers named n8-* / image match (the probe already exists in sidecar/src/ghost/api.rs — reuse it)
  • Surface a prompt/toast: 'N agent sessions are still running — reattach?'
  • Reattach = open a pane running n8 resume <session-id> (n8 already has a resume + picker: nemesis8/src/cli.rs)
  • Integration with Restore window layouts on app launch #83: during layout replay, if a saved pane was an n8 session, prefer reattach over fresh shell (store the n8 session id in the saved layout — extends Save window layout on close with modal prompt #82's SavedLayout)

Depends on

Standalone for the boot-sweep + prompt; the layout-replay integration depends on #82/#83.

Context

Follow-up from the herdr (ogulcancelik/herdr) comparison — see the 'Layout Persistence' sticky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions