Skip to main content

Module held_notes

Module held_notes 

Source
Expand description

srv’s informational [AgentMux] notes wait for the agent’s next turn instead of starting one. A note sent as input is a turn of its own: when MuxBus and the model API went down together, every agent spent minutes retrying a turn for a note that asked nothing of it, and the user’s own messages queued behind those turns.

A held note goes with the next message the agent’s pane is given by anything else (the user’s input, a jekt, a broadcast, a scheduled prompt), after that message’s own text (attach, taken by blockcontroller::deliver_agent_message_from and agent_handlers::run_agent_turn_joining). A pane holds one note per key, a newer one replacing the older, and at most MAX_PER_PANE. A terminal agent typed into by keystrokes is never given held notes.

A note the agent must get now (a worker’s report to its leader, the answer to its own request) goes through Handler::deliver_system_note instead.

Structs§

Attached
The notes taken for one message: held again when this is dropped, unless the message went (Attached::delivered).
HeldNotes
Held notes, per pane (block id): (key, text), oldest first.

Constants§

MAX_PANES
Panes with held notes at most; the one held for longest goes first (its pane is most likely closed).
MAX_PER_PANE
Notes one pane holds at most; the oldest goes first.

Functions§

attach
message with the notes held for block_id after it, and the guard that holds them again if the message doesn’t go.
attach_for_turn
attach for a turn from origin, except that a /compact AgentMux sends for the agent carries no notes: they would become part of its instructions, and Codex compacts only on exactly /compact (SPEC_AGENT_SELF_COMPACTION_2026_10_23.md §3.3). They stay held for the next turn.
forget_key
Drop the note held for block_id under key, if any (it went stale).
hold
Hold text for the pane block_id under key, replacing a note held under it. For a caller that already knows the pane; an agent’s name or UID goes through ReactiveHandler::hold_system_note.
put_back
Notes that went on a message srv then dropped (a deferred jekt that expired before the process could take it): hold them again for the agent’s next message, under their original keys. They are not the jekt’s to lose — a [AgentMux] note about the app’s own state outlives the sender’s deadline (#3894) — and the keys are what a later replace or forget_key for the same note acts on, so a restored note can still be superseded.
strip_attached
What a person wrote in a message that may carry held notes: the text before notes srv attached to it ([AttachedLog]). Text that only looks like attached notes, a pasted note say, is kept.
with_notes
message, then the notes held for its pane, one per line.