Skip to main content

Module close_pane

Module close_pane 

Source

Structs§

CloseOpts
How the caller’s frontend handles the layout.
ShutdownExtra
What a shutdown line can add beyond its step and text. Each is omitted when absent.
ShutdownLineEvent
One agent:shutdown line (mps_events::AgentShutdown): its order, step and text, and what the step adds.
ShutdownProcess

Constants§

SHUTDOWN_LINE_MAX 🔒
Display lines stay one short line (spec §12.1).

Statics§

SHUTDOWN_SEQ 🔒
Orders the lines: strictly increasing across the process, so per block too.

Functions§

clip 🔒
exit_line 🔒
The agent-process line for a shutdown outcome: (step, text, extra).
finish_close 🔒
After the saga: purge the block’s persisted broker history and its tool statuses, and lift the respawn guard. If the block somehow survived (dispatch failed), it keeps its stopped state and can be closed again.
gone_before 🔒
The requested ids that no longer existed when this close began.
process_extra 🔒
The extra for a line about one of the agent’s processes.
process_line 🔒
publish_shutdown 🔒
Publish one agent:shutdown line, scoped to the block. Display only: the saga’s own result stays the source of truth.
publish_shutdown_error 🔒
A close that failed after its shutdown: the pane stays open showing why.
queue_member_deletes 🔒
One frontend delete per closed member, in one batch (best-effort: the blocks are already gone).
run
Close block_ids (normally every member of one pane’s stack). Ids that no longer exist are skipped; ids in different tabs are rejected. On success returns {"tab_id": "...", "block_ids": [...closed...], "leaf_removed": bool}.
run_inner 🔒
run_with
save_final_state 🔒
Clear session:active_pid (so the next boot doesn’t read this as an interrupted session) and mark the local instance row stopped. The session id itself is left everywhere it is — block meta, instance row, shared registry — so reopening the agent resumes it (spec §4.2 step 6).
short_command 🔒
The program and its first arguments — enough to recognise it.
tell_frontend 🔒
Tell the window the pane is gone, after srv’s own tree already lost it. A window that still shows every member (frontend_waits, §5.5) gets one delete each, in one batch: its handler removes just that member, and the last one removes the leaf. That is queued whether or not the leaf goes, since closing one tab of a kept pane needs it just as much. Otherwise one delete for the pane, keyed on its visible block, not one per member, which is what produced the “could not find leaf node with blockId” errors when each member sent its own.
workspace_close_lock 🔒
Serialises tab closes within one workspace, from delete_tab’s last-tab pre-check through its DeleteTab dispatch (spec §9.5). One lock per workspace id; entries are tiny and bounded by the number of workspaces.