Chapters

Chapter 46

After a restart or a lost login

Your agents should be there after the Mac restarts, and after macOS ends your login without restarting it.

On this page
  1. A lost login
  2. A restart of the Mac
  3. Start at login: keeping is consenting
  4. What a restart loses
  5. Network trouble is not a lost login

Your agents should be there after the Mac restarts, and after macOS ends your login without restarting it. This page says what Dozable does in each case, what it needs from you once, and what a restart costs an agent.

A lost login#

macOS can end your login without restarting the Mac: when WindowServer quits (under heavy memory pressure, for example) the screen goes back to the login window, but the programs you started keep running. They are still attached to the login that ended, so they can no longer look up network names, find your user or open your Keychain: curl fails at once, id -un prints a number, Homebrew says your user does not exist. Restarting those programs from your new login is the only fix.

Dozable notices. While it runs in a login that has ended:

text
$ doz daemon status
…
login: dead (since 28 Nov 08:33)
  the login this daemon was started in has ended (macOS ended it without a restart — WindowServer quit): …

and doz doctor's live login row warns, with what to do. Doctor also names Dozable's own programs and Claude Code's background host when they still run from an older login, so you can quit them.

When you log in again, the login item (doz daemon login-item on, or the menu bar app's Start at Login) runs within a few minutes and replaces that Dozable:

  1. it asks the old one to hand over — its Sandboxes hibernate (nothing in them is lost), and each kept agent is ended so that it can be resumed;
  2. it starts Dozable again in your new login;
  3. the new one starts each kept agent again (Keep an agent running) in the same folder, with the same command, resuming the same conversation — Remote Control on your phone shows the same session — and wakes the Sandboxes;
  4. agents that were not kept are left where they are, and listed as left in the old login: in doz sessions @mac, doz daemon status, the workspace's room, and a notice on This Mac and the workspace's Agents tab, each with Restart. Dozable never restarts them for you.

An upgrade is not a lost login. When the new Dozable starts in a different login from the old one (the first doz after brew upgrade came over ssh, or your desktop's Dozable replaces one that ran over ssh), it takes over every agent that still runs, as it does after any upgrade: they keep running and nothing is listed. The one exception is a Claude Code agent with No fence that was started over ssh: it cannot read your login's Keychain there, so once it is idle Dozable restarts it in your desktop login, with the same name and conversation, and says so in its log.

A doz daemon stop you gave in the old login does not stop this: a stop counts only in the login it was given in.

Only this Dozable's own agents are touched. A second Dozable on the same Mac (another store) looks after its own.

A restart of the Mac#

After a restart, the login item starts Dozable when you log in, and Dozable starts each kept agent again the same way: same folder, same command, same conversation. Agents that were not kept stay ended: doz sessions restart @mac NAME starts one.

Start at login: keeping is consenting#

A kept agent starts again when you log in, with no second step, including one with No fence whose command bypasses its permissions. Keeping it was the consent. Who may keep such an agent, what clears "kept", and how to see what agents did for you: Keep an agent running, "Keeping is consenting".

What a restart loses#

A restart resumes the conversation, but the running program is new. Each automatic restart's notice (the workspace's room, or for an agent in no workspace This Mac's page and doz daemon status) says what went with the old one:

  • the turn in progress, when it was working: the answer it was writing is gone, so ask again;
  • its child programs, with the ports they listened on (node :4319, python3): a dev server it started is no longer running;
  • anything it scheduled inside its session, such as a /loop or a reminder.

Network trouble is not a lost login#

Every five minutes Dozable checks that its login is live, that network names resolve and that the model's API answers (any answer counts). When the login is live but the network is not, it says network trouble (in doz daemon status, doz doctor and the health feed) and restarts nothing. It never restarts an agent because the agent is quiet.

A conversation you run in a terminal is not Dozable's to bring back: move it in first, with doz agent new NAME --from claude:ID --no-fence --keep (Continue an agent you already run).

Edit this page on GitHub · Chapter 46 of 50