Expand description
A Browser call that needs the person doesn’t hold the agent’s turn (docs/specs/SPEC_WAITING_CALLS_RETURN_AND_FREE_THE_TURN_2026_11_10.md).
The call waits as it always did for a short grace, so a quick Allow still answers with the finished
result. If the request is still open then, the call returns “waiting for the person” with the request’s
id and the agent ends its turn; the banner stays up in the pane and a task of srv’s own waits for the
answer, carries the approved action out through the same checked path as before, and tells the agent
the outcome with a note that starts a turn. This module holds what the agent can ask about meanwhile
(Browser request_status, cancel_request) and the note.
In memory, like the hand-off log: a day, the newest few hundred. A request that srv’s restart cut off reads as unknown, and its banner goes with the pane’s next refresh.
Structs§
- Handoff 🔒
- A hand-off’s identity for the task that waits on it.
- Rec 🔒
- Status 🔒
- One request as the agent reads it.
Enums§
- State 🔒
- What became of a request.
Constants§
- GRACE 🔒
- How long a call waits for the person before it returns “waiting”: long enough that the usual quick Allow
is still one step for the agent, short enough that a person who stops to ask a question isn’t holding
the agent’s turn.
AGENTMUX_BROWSER_WAIT_GRACE_MSchanges it (tests;0returns at once). - KEEP 🔒
- KEEP_
FOR 🔒
Functions§
- any_
open 🔒 - Whether any request is open. A list of agents asks about each of them only then.
- deliver_
to 🔒 - One try at
textforagent, by the name the request was opened under. That is the agent’s stable slug, which the handler keeps bound after a rename, so its own resolution finds the agent; the display name in the registry is not what is asked for. - detach_
handoff 🔒 - The call that raised a hand-off returns “waiting” now; a task of srv’s waits on for the person’s Done or Cancel, records it as the call used to and tells the agent how it went.
- finish 🔒
- Settle request
id. The first settlement stands: an agent that cancelled it keeps that, and a late answer finds it over. Whether this call is the one that settled it. - grace 🔒
- handle_
ui_ 🔒browser_ request POST /api/v1/ui/browser/request— backsBrowser request_statusandcancel_request. An agent reads and takes down only its own requests.- lock 🔒
- make_
room 🔒 - Fewer than
keeprecords: those settled a day ago go, then the oldest settled ones. A request still open is never dropped for room. - open 🔒
- Record that request
id(its banner’s id) went toagentas a call that returned “waiting”. - open_on 🔒
- The request of an agent that is waiting on
pane’s person, if any: its id and what it asked. - open_
pane_ 🔒of - The pane of
agent’s own requestid, if it is still open: the pane the agent’s cancel answers it on (crate::server::browser_attention::withdraw). That call settles the request and marks it the agent’s own doing in one step, and the task waiting on the request reads the mark from its answer (crate::server::browser_attention::Settled::by_agent) and settles it so, without waking the agent. If the call fails the person answered first and the request stands. - outcome_
text 🔒 - The text the agent is woken with: what became of
question, and what to do next. - outcome_
text_ 🔒after outcome_text, for a hand-off with how long its banner was up (open_secs): “clicked Done after 7 s”.- paused_
text 🔒 - The refusal an agent’s other call on a pane gets while its request is open there:
paused(why its tools are paused) and, if the agent already got “waiting” for a request, that it ends its turn and doesn’t ask again. - pending_
for 🔒 - The pane where
agent’s open request waits for the person, if it has one: an agent between turns with one is waiting for the person (agent_runtime). Its oldest request, so every look gives the same pane. - status 🔒
- What became of
agent’s requestid, or its newest onpane. - status_
of 🔒 - table 🔒
- trimmed 🔒
- waiting_
json 🔒 - What a call that returned “waiting” answers.
- wake 🔒
- Tell
agenthow a request ended, with a note that starts a turn if it is between turns. Retried a few times: the agent may just be registering again.