Skip to main content

Module incidents

Module incidents 

Source
Expand description

The incident record: what went wrong and what AgentMux did about it, kept for the user (docs/specs/SPEC_RECOVERY_NOTICES_AND_TOASTS_2026_10_16.md §4.1). The host writes the cases it handles (agentmux-cef commands::incidents), the launcher the ones only it sees (a restart); the frontend shows each one the user hasn’t closed.

An append-only JSON-lines file in the instance’s data folder: an incident is one line, closing its notice appends an acknowledgement line. Written synchronously, since the writers are recovery paths that may be about to exit; incidents are rare, and each write is one small append.

Structs§

Incident
One incident, as the user is told about it.

Constants§

FILE_NAME
The file’s name in the data folder.
RESTART_ID_ENV
The environment variable the launcher starts a respawned srv with: the id of the incident it records for the restart.

Functions§

append
Append incident to the file at path.
append_ack
Append the acknowledgement of incident id.
append_interrupted
Append what srv found at start-up: agents agent processes were running when the previous srv died (session_recovery::scan_orphans). restart is the id of the srv_restarted incident whose respawn started this srv (the launcher passes it in RESTART_ID_ENV; a cold start has none and writes nothing). The two are written by different processes, in either order.
read
The newest max incidents at path, newest first, each with its acknowledgement. A missing file is no incidents.