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ยง

EVENT_AGENT_SHUTDOWN ๐Ÿ”’
agent:shutdown โ€” the shutdown log a closing pane shows (SPEC_AGENT_SELF_QUIT_2026_09_24.md ยง5.5, ยง12.1).
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 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.
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.