Durable sessions
Terminals that outlive the UI, reattach after sleep, and restore honestly after a restart.
A Harmony terminal is not a process owned by a window. It is a PTY session owned by the local session host and daemon. The UI is a disposable view: it can detach without ending the underlying work, while durable checkpoints make restart recovery possible when the original OS process cannot survive.
What survives what
| Event | What happens |
|---|---|
| Close the desktop window | Harmony hides to the tray. The same local PTYs keep running; reopening the window reattaches with scrollback. |
| Choose Quit UI | The Electron interface exits while the daemon/session host keeps local sessions running in the background. Relaunch to reattach. |
| Close the laptop / OS sleep | The operating system pauses every local process. On wake, Harmony renews session authority, rechecks process state, and reattaches. Work does not compute while the hardware sleeps. |
| Reboot the machine | No OS process survives a reboot. Harmony restores pane layout, terminal history, tasks, and checkpoints from disk; an agent resumes only when its provider has a valid resume binding, otherwise Harmony restores the shell and shows the available recovery path. |
| Choose Exit Harmony | Harmony deliberately stops the background processes. Durable layout/history checkpoints remain available for the next launch, but this is not a same-process reattach. |
| Suspend a session | Suspended sessions persist to disk with a 7-day TTL. Resume any time within the week with nala resume <sessionId>. |
| Agent restart | Harmony captures provider resume bindings when available and reports whether the result was reattached, respawned, or needs help. It does not invent exact continuation when a provider cannot prove one. |
Scrollback is configurable from 1,000 to 100,000 lines per pane and is replayed on reattach.
The launch and reattach path
How recovery works
The daemon checkpoints session state to disk continuously. A live reattach keeps the same process. A restart recovery reconstructs panes and scrollback, then uses only the resume capability that the agent/provider actually reports. Shell integration does the quiet bookkeeping:
- OSC 133 marks prompt boundaries, so command history and status survive meaningfully, not just as raw text.
- OSC 7 reports the working directory, so restored panes reopen in the right folder.
- OSC 9/99/777 drive desktop notifications; OSC 7727 keeps the git branch indicator live.
Hooks for PowerShell, Bash, and CMD are injected automatically. Nothing to configure.
Pausing on purpose: /stay and checkpoints
Inside the TUI, /stay pauses a session with a durable checkpoint (options: --now, --after-tool, --detach, --reason). /resume (or its friendly alias /come) picks it back up, in any terminal, on any surface.
nala sessions list # everything the daemon is holding
nala sessions show <id> # details of one session
nala resume <sessionId> # bring it back
nala sessions archive <id> # tidy it away
Why this changes how you work
Durability removes the two classic terminal taxes: the "don't close that window" anxiety, and the "rebuild context every morning" ritual. Long-running agents can run overnight while the machine stays awake; a week-long debugging saga can retain one durable record; and a reboot restores the saved workspace without pretending the original process survived. It also gives A2A messaging a durable inbox and cursor, so delivery does not depend on the UI being open.