Skip to main content

Module sagas

Module sagas 

Source

Modules§

agent_notice
An agent doing something the person may want to stop, told to the person in the agent’s own pane (docs/specs/SPEC_AGENT_SPAWN_NOTICE_IN_THE_PANE_2026_11_08.md): starting an agent, using the person’s SSH keys on a host, using a Google connector, adopting memory. It replaces the approval window that opened over the pane and refused when nobody clicked.
agent_teardown
capture_mask
The private and secret rectangles of each AgentMux window, read at the instant of a UI window capture (docs/specs/SPEC_DEEP_LINKS_ONE_FRAMEWORK_2026_11_20.md §7, G5).
close_pane
credential_notice
A container agent that can’t get a credential, told to the person in the agent’s own pane.
deeplink_open
An agent’s deep-link open, carried to the window and its outcome carried back (docs/specs/SPEC_DEEP_LINKS_ONE_FRAMEWORK_2026_11_20.md §4.2, R3, G9).
delete_block
delete_tab
delete_workspace
log
orphan_reaper
pane_confirm
A question srv asks the person in the pane it is about, as a modal that covers only that pane (docs/specs/SPEC_AGENT_SPAWN_NOTICE_IN_THE_PANE_2026_11_08.md §6 rows 3 and 6): add a host to the ssh config, remove or install AgentMux’s helper, end a durable session, run a system tool’s install command. Each is the confirmation of the person’s own click in a pane (Remotes, Toolchain, a terminal), so the question belongs to that pane. It used to open an approval window over the whole AgentMux window.
park_agents
pending_shutdown
promote_block_to_tab
recovery
redock_floating_pane
restore_torn_off_tab
self_quit
sensitive_fallback
A request nobody reviewed (SPEC_SUPER_AGENT_2026_10_25.md §6). The request still gets its countdown; only the agent in front is missing. When no super agent holds the seat or runs here for a few seconds, or the one that does hasn’t answered in two minutes, the countdown starts anyway with twice the usual window (at most the longest), the banner says no super agent reviewed it, and the person’s veto is the only check.
sensitive_runners
What runs each sensitive operation when its countdown ends unvetoed (SPEC_SUPER_AGENT_2026_10_25.md §4, §5). Each runner calls the operation’s own code path unchanged: no power is added, only who may start it.
sensitive_window
The countdown for an approved sensitive request (SPEC_SUPER_AGENT_2026_10_25.md §5), beside pending_shutdown’s window for stops and closes. open starts the clock; the person can veto it, or approve it now to skip the wait. No click is needed to let it proceed: at the deadline the operation runs as the super agent’s approved act on behalf of the requester, through the runner registered for its operation. Each operation’s own code path runs unchanged, so no new power is added; only who may trigger it changes.
tear_off_block
tear_off_tab
teardown_hooks 🔒
The sagas’ side of backend::teardown_hooks: the watchdog, the controller replace and the tab close call these through the hook, so backend/ does not name the agent teardown.

Structs§

SagaCtx
Read-only context passed to a saga’s inner async function. Wraps the AppState handle and the saga’s allocated id.

Enums§

SagaTerminal
Outcome a saga’s inner future hands back to emit_terminal.

Constants§

SAGA_TIMEOUT 🔒
Maximum wall-clock time a saga is allowed to run before the coordinator force-fails it. Tear-off sagas should complete in tens of milliseconds; the budget is generous to absorb SQLite write spikes without flapping in CI.

Functions§

alloc_saga_id
Allocate the next saga_id. Monotonic per srv-process run.
classify_run_saga_result
Convenience: classify the standard run_saga Result<Value, String> outcome into a SagaTerminal.
emit_saga_started
Emit Event::SagaStarted for a freshly-allocated saga_id. Sagas call this immediately after alloc_saga_id so subscribers see the start record before any per-step events.
emit_terminal
Emit the saga’s terminal lifecycle event + durable log row.
run_saga
Run a saga’s inner future under a 5 s timeout. The inner future is responsible for emitting SagaStarted (the saga itself, since it owns the saga_id allocation) and any compensation it needs; run_saga only enforces the timeout and emits the terminal SagaCompleted / SagaFailed.