Skip to main content

Module reactive

Module reactive 

Source
Expand description

Reactive messaging system for agent-to-agent terminal communication. Port of Go’s pkg/reactive/.

Provides message injection into terminal panes, agent registration, rate limiting, message sanitization, audit logging, and cross-host polling via AgentMux Cloud service.

Re-exports§

pub use handler::get_global_handler;
pub use handler::Handler;
pub use handler::ReactiveHandler;
pub use poller::Poller;
pub use sanitize::broadcast_turn_message;
pub use sanitize::device_turn_message;
pub use sanitize::format_injected_message;
pub use sanitize::sanitize_message;
pub use sanitize::validate_agent_id;
pub use sanitize::validate_muxbus_url;
pub use types::*;

Modules§

action_audit
The audit line for a recorded RPC call (backend::rpc::action_record): kept like the jekt lines, in the ring behind GET /agentmux/reactive/audit and in the audit file. event_kind is action; outcome is the command; source_agent is the actor (agent:<id>, operator or unproven); target_agent and block_id are what it acted on; reason names the identifier it acted on; success and error_message say how it went.
activity_watcher
Empty-title recovery: a running agent with conversation and no usable session title gets one, written straight to its block’s term:ambient_summary, which the pane header and the Swarm row read.
audit_store
The durable copy of the jekt audit trail. The handler keeps the last AUDIT_LOG_MAX entries in memory for GET /agentmux/reactive/audit, and loses them at every restart. Every entry is also appended here, as one JSON line, to a file that is never rotated or truncated: AgentMux keeps agent history, and the record of what agents did, forever.
cli_native_audit
Audit lines for messages agents send each other through the CLI’s own messaging (backend::cli_native), kept like the jekt lines: in the ring behind GET /agentmux/reactive/audit and, for good, in the audit file. As with jekts, a line holds the text’s hash and length, not the text.
controller_wait
An agent whose pane is open but whose controller is not there yet.
handler
held_notes
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.
held_request
A held jekt row turned back into the request it was accepted as, for the replay (server/jekt_held.rs, which re-exports it). It reads only the row and the ack policy, so the reactive tests reach it from the core.
poller
post_secrets
What a text posted for others to read (a bulletin or a channel post) must not hold besides credential words (sanitize::post_refusal_reason): a value AgentMux knows to be a secret, and a credential word beside a value. The refusals name the rule, never the text that matched.
progress_watcher
Pushed per-agent progress: the agent’s current todo checklist and the tool it is running right now, published as an agent:progress MuxEvent so the Swarm pane can list them under the agent’s name.
rate_limiter
The jekt handler’s rate limiter: at most max_tokens deliveries a second.
registry
File-based cross-instance agent registry.
sanitize
sender
Whether a jekt’s sender name can be shown as an agent’s.
sensitive_audit
The typed audit fields of a sensitive-op decision (REPORT_AGENTS_AND_OS_PROMPTS_2026_11_07.md §4.6): the dialog’s text, the exact answer, its risk level, and whether a remembered grant allowed it rather than a fresh countdown. Split out of handler.rs (over the file-size baseline) the same way action_audit.rs and cli_native_audit.rs already are: its own file, built on Handler’s fields the way those are.
sent_audit
The sender’s half of a message’s trail: the sent line written where a message is handed to this srv. The receiving srv writes the line it writes today under the same message id (msg_id), and audit.query joins the two into one row. A message another srv handed over (a peer, another channel, the cloud) has no sent line here: its sender wrote it.
system_turn
A turn started by AgentMux itself (a note that asks the agent for something, such as its status after a sign-in), by the same sender a message takes. Split out of handler.rs (over the file-size baseline) the way sensitive_audit.rs is.
transcript_request
transcript_request/transcript_response wire payload — muxspect Phase B/C’s LAN/WAN conversation-visibility protocol (docs/specs/SPEC_MUXSPECT_CROSS_TIER_CONVERSATION_VISIBILITY_2026_08_21.md, jekt tier rules confirmed in docs/specs/SPEC_JEKT_TRANSCRIPT_REQUEST_TIER_RULES_2026_08_22.md).
turn_audit
What a message did to the agent’s turns, for the audit (SPEC_CHEAPER_FLEET_MESSAGING_2026_10_30.md §7).
types

Constants§

DEFAULT_POLL_INTERVAL_SECS
Default poll interval for AgentMux poller (seconds).
MAX_MESSAGE_LENGTH
Maximum message length in bytes.
TRUNCATION_SUFFIX
Suffix appended when a message is truncated.
UNAVAILABLE_PREFIX
How a refusal to deliver to an agent that can’t work now begins: its account is out of quota or signed out (SPEC_UNRESPONSIVE_AGENTS_2026_10_23.md §5). Only where the message can’t be held: a LAN or cross-channel hop, a cron fire, a Swarm broadcast.

Functions§

held_input_wake
Woken whenever an agent registers, so the input held for an agent that was stopped goes out as soon as it starts (server/held_input.rs). Its own, as a Notify hands one wake to one waiter.
held_jekt_wake
Woken whenever an agent registers, so jekts held for an absent agent are replayed promptly (SPEC_DURABLE_JEKT_DELIVERY_2026_09_24.md §2.3). notify_one does no I/O, so it is safe under the handler lock.
is_spawn_gate_refusal
Whether a delivery error is the target’s spawn gate refusing to start it (run_agent_turn’s “identity spawn gate: …”): not signed in. Recoverable once the receiver signs in (SPEC_JEKT_DELIVERY_STATES_AND_MAILBOX_2026_10_01.md Phase 0 item 4, G4).
is_transient_delivery_error
Whether a delivery error is worth retrying shortly, as is: the target is still absent, rate-limited, its queue is full, it is starting, restarting or stopping (“… try again shortly”), or its pane is open and its controller is not there yet (controller_wait). Shared by the held-jekt replay and the cron scheduler’s pending fires, which must agree.
is_unavailable_refusal
Whether a delivery error is UNAVAILABLE_PREFIX’s refusal: recoverable at the reset, confirmed sign-in or an account move.
registered
An agent just registered in block_id: replay what was held for it, wake the relay subscription to take its names, and after an upgrade tell a resumed agent once, whatever runs it (SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md §5.2). No I/O here: safe under the handler lock (the note is sent from a task of its own).