Skip to main content

Module agent_state

Module agent_state 

Source
Expand description

Whether each agent is working, waiting on the user, idle, stopped or failed, and since when: the agent_status the LAN fleet feed, GET /agentmux/reactive/agent-names and (through the feed’s snapshot) the cloud presence record carry (agentmux-mobile’s SPEC_AGENT_STATUS_AND_LIVE_PANE_FEED_2026_10_07 §3, §13.1).

decide is the rule, pure; current_state reads its inputs from the block’s controller and the block’s meta; a SinceTracker remembers when each block’s state began. Every caller goes through agent_status_of_block or a SinceTracker of its own, so the feed and the names route agree on since_ms.

Structs§

AgentStatus
A state and when it began (unix ms, this machine’s clock).
SinceTracker
When each block’s current state began. A state seen for the first time (srv start, a new agent) begins when it is seen; a state that changes begins again; None forgets the block, so a stopped and restarted agent does not inherit an old start.
StateInputs
What decide looks at, as read from the controller and the block.

Enums§

AgentState
An agent’s state as the wire reports it.

Constants§

META_AWAITING_USER
Block meta the agent pane sets while a question waits for the user.

Statics§

TRACKER 🔒

Functions§

agent_status_of_block
The agent on block_id: its state now and since when.
current_state
The block’s state now: its controller’s runtime status and the block’s term:awaiting_user. None without a controller, or when the block can’t be read.
decide
The state, or None when nothing tracks this agent’s turns (a terminal pane: shell / cmd, or any controller that isn’t an agent’s) or its process state is unknown. Saying nothing beats a wrong idle.
global_tracker
The tracker the live fleet source and the names route share.