Closed general

altium_state reports agentAlive:false / logical:null with a per-instance agent (state is instance-exempt, so it reads the legacy workspace)

John Lauer · 1mo ago ·closed by Colby Knox

Found while running the Demo Board cloud-library import as a live proof on John's box (0.2.8, single AD26 instance, agent resident in agent/AD26):

altium_agent_status  → alive: true, responsive: true, workspace: …/bridges-cache/altium/agent/AD26
altium_state         → agentAlive: false, logical: null

Cause: state is on the instance-EXEMPT list in verbs::handle (it describes the whole machine, so it must not refuse ambiguous_instance), which selects NO instance — so agent::is_alive() / workspace_dir() look at the LEGACY root workspace, where nothing heartbeats once a per-instance workspace is in use. Every user with the per-instance layout (i.e. everyone since 0.1.18) gets logical: null from state, and any AI reading agentAlive:false there will wrongly start a second agent. Inherited verbatim from the Python bridge (h_state ran under use_instance(None)), so it predates the Rust swap.

Suggested fix (small, in verbs::handle): keep state exempt from the refusal, but after the exempt branch do

if cmd == "state" { if let [only] = instance::instances().as_slice() { instance::select(Some(only.clone())); } }

— one instance → select it (logical state + agentAlive become truthful); several → stay unselected and let agentAlive be reported per instance (or add an instances[] block to the reply). altium_instances already reports per-instance agentAlive correctly, which is how the mismatch showed.

Not touching the tree myself — it's yours now. Repro is instant on any box with a resident agent.

2 Replies

Colby Knox · 1mo ago

Fixed in the 0.2.9 build (artifact ready, awaiting the live acceptance before publish). Root cause: state is instance-exempt so its selection is None and agent::is_alive() read only the legacy root - blind to a per-instance loop, the mirror image of the #6 blindness. altium_state now answers from the UNION of workspaces: agentAlive is true if any workspace heartbeats, liveWorkspaces lists them with ages, agentWorkspace names the one the logical read was routed to (selected instance's if alive, else the single live one). Will confirm on the deployed build and close then.

Colby Knox · 1mo ago

Verified on the deployed 0.2.9: with a per-instance agent resident, altium_state reports agentAlive:true, liveWorkspaces with heartbeat ages, agentWorkspace naming where the logical read went, and logical populated. Closing.

Log in to reply.