Skip to main content

Module pending_shutdown

Module pending_shutdown 

Source

Re-exports§

pub use batch::request_batch;

Modules§

batch 🔒
One window for several agents (SPEC_COUNTDOWN_BUTTONS_AND_BATCH_AGENT_ACTIONS_2026_10_28.md §4). A Stop agents over five agents is one request: one deadline, one OS notification (“Closing 5 agents: A, B, C and 2 more in 30 s”) with Keep running and Close now for all of them, and one audit entry. Each agent’s own pane keeps its banner, and its Keep running keeps that agent only.

Structs§

BatchBlock
An agent of a batch.
BlockOutcome
What became of one agent of a batch.
Entry 🔒
PendingClearedEvent
agent:shutdown-pending-cleared: the request ended, and how.
PendingView
A request as the caller and the frontend see it (§12.2).
RemoteRequest
A request opened on another AgentMux instance on this machine (a cross-channel FleetBulkStop target, whose user is asked there): where its status lives. status for these is proxied (see remote_for).

Enums§

Action
What happens if the user lets the window run out.

Constants§

BROWSER_CLOSE_WINDOW
Closing a browser pane: it holds no conversation to lose, and the person is looking at it.
BY_MAX 🔒
The longest asker name the banner and toast show.
KEEP_FINISHED_MS 🔒
Finished requests stay answerable this long, then are dropped.
OVERRIDE_WINDOW
How long the user has to keep what another agent asked to stop or close: 30 s, the default for a human override.
SELF_QUIT_WINDOW
An agent’s own quit, from a turn the user didn’t start: it waits for that turn to end anyway, so its window stays short.

Statics§

ENTRIES 🔒
REMOTE 🔒

Functions§

active_for
The request for this block still waiting on the user or already under way, if any.
asker_name 🔒
The asker as the user knows them: the display name of the agent whose id by is (QTest, not qtest), else by as given (a fixed app string, a name another AgentMux claims, or an agent that is not running).
audit 🔒
The outcome, once per requester, each as its own source (§6.5 step 8).
audit_note
The request-time audit note: whether this caller opened the window or joined someone else’s.
begin 🔒
pending → proceeding, atomically, handing over the action to run: exactly one of the window running out and the user’s Keep running wins (ReAgent P1 on #3789 — checking and setting under separate locks let a late check see pending after a keep).
clean_by 🔒
The asker’s name, cleaned for display. Normally a verified agent id; the only other sources are fixed app strings and a name another AgentMux on this machine claims (cross-channel), so it gets the same treatment.
clean_reason
A caller’s reason, cleaned for the user to read (spec §3.11). Replaced wholesale by REASON_HIDDEN when it trips the keyword list the jekt tier gate and notification previews use; otherwise its first line, control and bidi-override characters removed, whitespace collapsed, cut at REASON_MAX. Markup is not interpreted here: the banner renders it as text and a toast never carries it.
cleared 🔒
close_now
“Close now” (the second button of the banner and the toast): the person ends the wait, and the shutdown begins at once as it would at the deadline. closed_now if the request was still pending, too_late if it was kept, had begun, or is not this block’s. Only the person’s: the RPC and the toast press that call it are proven by the caller.
close_window
How long the user has to keep these panes when an agent asks to close them: BROWSER_CLOSE_WINDOW when every one is a browser pane, else OVERRIDE_WINDOW.
covers_of 🔒
Every block a request covers; empty once it’s forgotten.
entries 🔒
is_active 🔒
keep
“Keep running” (§12.3). kept_by_user if the request was still pending, too_late if the shutdown had already begun (or it isn’t this block’s).
names 🔒
Whether a press or banner naming block_id is about this request: one of its blocks, or its toast’s group.
notify_router 🔒
prune 🔒
publish_pending 🔒
agent:shutdown-pending for view, to the pane at block_id.
raise_toast 🔒
The OS notification for view’s request: what will happen, the time left to its deadline, and Keep running. Raised when the request opens, and again when a stronger request takes it over (the same toast is replaced in place, since both share the block’s notification group).
remember_remote
Remember that request_id lives on the instance at local_url.
remote_for
The instance a forwarded request lives on, if it is one.
request
Ask to shut block_id down, subject to the user’s override. A request already pending — or under way — for the block is joined instead: the clock never restarts, and no second window opens beside it (ReAgent P1 on #3789: a second banner’s Keep running could not stop the first). A joiner whose action does more (see Action::rank) replaces the pending action and is named on the banner, so nobody is told the outcome of less than they asked for (ReAgent P1 on #3798). The returned view says whose request it is: a caller whose by/via differ has joined someone else’s.
request_within 🔒
run_action 🔒
send_settled_note 🔒
session_running 🔒
Whether the block’s session is running, not merely registered: a stopped agent keeps its controller (Policy::stop), and the Keep running button of its notification would restart nothing (it reads “Keep open” instead).
set_status 🔒
settled_note 🔒
One requester’s audit note when the request settles: the outcome, how it asked, and its reason exactly as sent (never the cleaned text the user saw).
settled_text 🔒
What a caller that did not wait is told of an ended request: which agents the user kept running and which closes failed. None when everything it asked for was closed (or was already gone).
spawn_window 🔒
Wait out the window (or the user’s Keep running / Close now), then run what was asked and settle.
status
tell_requesters 🔒
The note for everyone tell_when_settled registered, once the request has ended.
tell_when_settled
Have by told, by one [AgentMux] note, how request_id ended if the user kept what via asked to close or the close failed. For a caller that did not wait for the window; a close that went ahead says nothing, as the caller asked for it. A request that has already ended tells at once.
toast_block 🔒
The block (or, for a request over several agents, the group) its OS notification belongs to.
toast_body
The OS notification’s body for a pending shutdown. App-controlled text and the asker’s name (cleaned); the reason is left out on purpose. “My Agents” is only for a closed agent tab: a pane close now reaches only panes that hold no agent (a browser, an editor), which have no conversation to keep.
wait_at_least_ms
How long a caller should wait, at least, for a request with this deadline.