Recovery and work context

What happens to the work when the application is closed, the agent has fallen or the limit has been triggered, and how Pulse returns you to the same place. Stage 1 of the post-benchmarking plan (version 0.30.2).

Register of requests

Each user command - prompt, stop, cancel - gets an entry in the registry pulse-requests.json (application data folder). The record has two independent fields:

Field What does it mean
Receipt (accepted) main received the command: the turn has started or queued; the turn number is known
Exodus (done / failed) execution ended or failed to start
unknown the application restarted without recording the outcome

The receipt is returned immediately, without waiting for the end of the turn. Repeating a command with the same idempotency key receives the previous receipt, and not the second turn - and after a restart, too, because the registry is saved on disk. A prompt that was not accepted before the restart is repeated only by explicit human decision (see below), and not by itself.

The source of the command is stored in the record: window, telephone, internal call.

Reason for stopping

A session whose progress is not terminated receives a reason:

Reason When
Interrupted by application restart the session was running at the time the application was released
Agent error the agent process has crashed or failed; error text next to it
Stopped by limit task budget, turn or time limit
Aborted by timeout swarm task not completed on time
Stopped by user "Stop" button, deleting a task
Swarm mission canceled owner's decision on swarm

The reason is visible in the sessions column under the session name and is removed with the next turn. An emergency exit is never signed as a stop by the user; the time the application is turned off is not counted as agent work. Swarm jobs that are open at the time of exit are canceled with the label “Interrupted by application restart.”

End of turn on failure

  • "Stop" ("Cancel") on a hung agent does not hang in "Stop": if the process has not responded to session/cancel in 12 seconds, the turn is achieved by force stop — the status is cleared, the queue of prompts is released, the process ends (audit 09/24).
  • A prompt removed from the queue (stop, cancellation, failure of the previous turn) does not disappear silently: its text and the canceled turn remain in the transcript.
  • An agent crash in the middle of a turn immediately clears the pending permission request (not after a 10-minute timeout) and closes its open calls to tools with the “canceled” status - cards do not hang “pending” either in the live session or in the restored transcript.
  • stop does not leave status when restoring a working folder (between turns of a live session) running without a live process: the turn is rejected “agent launch cancelled.”

"Requires attention"

The dashboard begins with a list of blockers that are waiting for a person:

  • permission request;
  • agent question at the end of the turn;
  • session error;
  • test result;
  • swarm member branch merge conflict;
  • interrupted turn (restart, error, limit, timeout);
  • unknown outcome of the request;
  • task limit has been reached.

Each entry has an address transition: “Open” leads to the desired task, session and tab. Reading does not close the record - it disappears when the blocker is removed: permission is given, a new turn is started, the result is accepted. The only explicit closure is “Close Question” for an unknown query outcome; if the prompt was not accepted before the restart and its text was saved, “Send again” is available - the repetition occurs with the same idempotency key: if the command was nevertheless accepted, the gateway will return the previous receipt, and the second turn on it will not start (this is protection against double). The list is ordered by time and does not jump when the state is updated. The number of blockers is shown by a badge on the “Dashboard” section.

Saving work context

Restarting returns the window to the same place: section, open task, selected session of each task, tab (Session / Diff / Graph / Terminal), board search and filters, graph depth, direction and camera, selected team project, measurement report section, panel sizes and message drafts. The deleted task does not open - instead of it there is a board; selected sessions of non-existent tasks are discarded.

Restoring does not trigger anything: show the previous location is an interface operation, not a command to the agent.

Explicit working copy

An isolated author works in his own folder, not in the task's worktree. The sessions column shows “working copy · .../folder” for such sessions, the swarm participants show “their worktree · branch”. The composer sends the prompt to the selected session, the task header shows the task folder.

The owner of the performance is the machine

The agent's turn belongs to the Pulse process on the machine, not to the person who started it. Hence the rules that apply to all inputs - window, telephone, external agent MCP server and schedules:

  • Loss of connection ≠ stop. Rebooting a window, losing the phone connection, exiting the MCP client without waiting for a response - none of this interrupts the progress or rolls back the command. You can stop the turn only with an explicit command (cancel/stop), and she has her own entry in the register with a receipt and source.
  • The Pulse launch has an identity. Each process launch has its own bootId (src/main/hostBoot.ts); he comes to the phone hello, to an external agent - in /health and in the list of commands (pulse_commands), and each registry entry is stamped by the launch that accepted it. A receipt from a previous launch is not a promise from a current one.
  • The client distinguishes between a restart and an abort. After reconnecting, the phone compares bootId: coincided - the turns were going on all this time, just finish reading the tape with the cursor; didn’t match - what was in flight was interrupted, and the phone shows a warning and a list “Requires attention” (attention.list) with the entries “outcome not confirmed.” The phone reads the outcome of its command using its key (request.get), and repeating with the same key gives the same receipt, not the second turn. When the remote control is interrupted, the header says “the connection is lost - the machine continues to operate”, and not “stopped”.
  • Defense of an old attempt. An event, a swarm report, or an integration from a previous agent process is rejected (process generation in sessionManager, the turn number of the swarm task); the launch of “catch-up” turns after a restart does not occur on its own - only by the decision of a person from the “Requires attention” list.

What's not here yet: execution lives while Pulse is running. Moving runtime to a separate process or to another host (the process continues when the application is closed) is a separate project; bootId, a register with receipts and the “break/restart” distinction are its prerequisites.

Limitations

  • The registry stores the last 300 entries and prompt text up to 20,000 characters; Longer text remains truncated and is not prompted to “Send Again.”
  • The outcome of a turn that started before the restart is not automatically restored from the transcript: the entry is marked “not confirmed”, verification is up to the person.
  • The graph camera is stored for a single task graph; The fleet graph is re-entered.
  • The idempotency key is not restored on the window side after a window restart; The main registry serves as protection.