Expand description
Helpers the tool handlers share: cron, durations, quit-self and bulk-stop outcomes, delivery text. Split out of main.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.2).
Constants§
- HELD_
IDLE 🔒 held_reasonof a message kept for a session gone cold (srv’scold_hold::REASON_IDLE).- HELD_
QUOTA 🔒 held_reasonof a routine message kept back by quota mode (srv’scold_hold::REASON_QUOTA).- INJECT_
TIMEOUT 🔒 - How long a send waits for srv’s answer. srv’s own tiers for an agent it does not run (a LAN peer, the cloud relay, then the hold) can add up to more than the client’s default 10 s, and srv finishes the delivery anyway.
Functions§
- add_
stop_ 🔒notes - The
noteof aStop agentsresult: what srv said (a passedsignalorstagedno longer applies) and, for a target on an older AgentMux on this machine, which only stops (its answer names theeffectstop), that its pane was left open. - await_
shutdown 🔒 - Polls srv for a shutdown waiting on the user’s override
(SPEC_AGENT_SELF_QUIT_2026_09_24.md §6.5) until it leaves
pending— andproceedingtoo whento_the_end— and returns the last status seen. One long request instead would outlast the client’s own timeout. - await_
shutdown_ 🔒of await_shutdownfor a caller whose own pane may be one of several in a request: it also stops waiting once the user has answered forown(kept it), which the request’s shared status does not say until every other agent has been dealt with.- close_
pane_ 🔒outcome close_pane_outcomefor an answer that did not carrypane_closes.- close_
pane_ 🔒outcome_ for - What
ClosePane block_id=andBrowser closetell the agent once the tab’s user has answered (§6.5): the tab is named, and so is whether its pane went with it. - close_
pane_ 🔒pending Stop paneon another pane: srv’s 202 answer, as the agent sees it. A request that joined a shutdown already under way (viais not a pane close) says whose it is and that the pane may outlive it.- cron_
set_ 🔒enabled - deferred_
delivery_ 🔒text SendMessage’s answer when srv accepted the message but queued it: the target’s process is starting up, restarting or stopping (SPEC_JEKT_IMMEDIATE_DELIVERY_2026_09_28.md §2.1), or it runs one turn at a time (a container agent, a Codex or Gemini agent) and is in one now, so the message waits for that turn to end. A persistent agent that is up gets it at once, mid-turn included, and is reported as delivered.- delivery_
failure 🔒 - The error for a message srv neither delivered nor held.
- format_
duration 🔒 - Human-readable representation of a clamped Duration — used in the Loop success message so the reported cadence matches the actual run cadence.
- held_
text 🔒 - The reply to
held: true: srv kept the message and says why and until when. - held_
until_ 🔒active - Which of the two “kept until the agent is next active” holds srv’s answer names, for a send to many: a held message is not a failed one.
- inject_
transport_ 🔒error - What a send tells the sender when srv’s answer did not arrive, in place of the transport’s own words (“error sending request for url …”), which say nothing about whether the message was kept.
- own_
outcome 🔒 - One target’s own answer from a settled request over several agents: srv lists what became of each
agent (
outcomes), while the request’s ownstatusis for all of them. A request for one agent has no list, and its answer is the target’s own. - pane_
goes_ 🔒note - What srv said about the pane when it took the close of a tab (
pane_closes): whether the pane goes with it. - parse_
interval 🔒 - Parse a loop interval string into a
Duration. Accepts a number with an optional unit suffix:s(seconds),m(minutes),h(hours); a bare number is treated as minutes. Clamped to [10s, 24h]. - pending_
note 🔒 - What
Stop paneandStop agentssay instead of waiting for the user’s window: the call returns at once, srv runs the window, and the agent is told by one[AgentMux]note only if the user keeps what it asked to close or the close fails. - pending_
windows 🔒 - The windows a stop opened, one per request id (several targets can share one): their targets and
when each closes unless the user keeps it.
pendingis srv’s list of {block_id, request_id, deadline_ms?};fallback_deadline_msis the answer’s own deadline, for an entry without one. - public_
stop 🔒 - srv’s name for a pending shutdown’s tool (its audit log keeps the endpoint names) as agents call it now.
- quit_
self_ 🔒outcome - What
QuitSelftells the agent once the user’s override window has settled (§6.5). - quit_
self_ 🔒result - What
QuitSelftells the agent, from srv’s answer (§4.2, §6.3). - send_
message_ 🔒outcome - What
SendMessagetells the sender, from srv’s/agentmux/reactive/injectbody. Each answer keeps its first word (Delivered,QUEUED,HELD) so existing prompts keep working, and adds the message id and the receiver’s condition where srv’s answer already implies it (SPEC_JEKT_DELIVERY_STATES_AND_MAILBOX_2026_10_01.md §5.2, Phase 0 item 3). - sent_
text 🔒 - The reply to
success: true, which is either a delivery or a message queued at the relay.