Skip to main content

Module self_quit

Module self_quit 

Source

Structs§

QuitSummary
ShutdownPreview
What shutting an agent down would end, read without ending it: what the confirm names.

Enums§

GateRefusal
Why QuitSelf doesn’t proceed at once (§6.3). Until Phase 2b’s override window exists, every one of these is a refusal (spec §9: the non-user path ships with 2b).
QuitOrigin
Who asked.

Constants§

SELF_QUIT_TURN_GRACE
How long a scheduled quit waits for the turn to end (§4.2); after that the graceful shutdown interrupts it.

Statics§

QUITTING 🔒
Blocks with a QuitSelf waiting for their turn to end (§4.2’s mark_quitting): a second call answers already_quitting.

Functions§

gate
The §6.3 gate: may QuitSelf proceed without asking the user?
gate_upgrade
The gate for App upgrade: gate, except a Swarm broadcast doesn’t count as the user’s word. An upgrade restarts AgentMux once for the whole machine, so a broadcast to ten agents would have all ten try it; the user is asked instead. A broadcast still authorizes an agent quitting itself.
is_quitting
normalized 🔒
preview
ShutdownPreview of the agent in block_id.
quote_matches
§6.3: the quote must appear in the user’s message, whitespace- and case-insensitively. An empty quote never matches.
run
run_policy 🔒
run_shutdown
A shutdown the person asked for. stop_background is their answer to “stop its background tasks too?”: they are kept otherwise, as a quit has always kept them.
run_with
run with an audit detail (for QuitSelf: the reason and the user’s quoted instruction).
schedule_after_turn
§4.2: the tool call is part of the turn that asked for it, so quit when that turn ends (or after SELF_QUIT_TURN_GRACE), not now. Returns false when a quit is already scheduled or under way.