Expand description
One live instance per agent across the WAN — the client side
(docs/specs/SPEC_AGENT_SINGLE_LIVE_INSTANCE_2026_09_24.md Phase 5, §4.5).
The muxbus relay holds one lease per agent. This instance claims it for every agent it polls jekts for, renews it while the agent stays registered, and releases it when the agent goes away. While another instance holds it, the relay answers this instance’s pending pulls with 409 — so it cannot consume the other instance’s jekts — and this module reports the agent as held elsewhere, which fences the local holder (the newcomer yields, D1).
Fails open everywhere (D2): a relay without the lease routes (404), an unreachable relay or a transient error never stops delivery or spawning.
Structs§
- HeldBy
- What the relay says about another install holding an agent’s lease.
Enums§
- Holder
- The relay’s answer to “which install holds
agent’s lease?” —GET /agents/lease/:agent_id(docs/plans/PLAN_JEKT_LOCAL_FIRST_ROUTING_2026_10_02.md§7.1). Asked by a sender about a message’s target, so it never touches this instance’s own lease state ([record], admission): a read only. - Outcome
Functions§
- forget_
elsewhere - Drop a cached “held elsewhere” answer for
agent— after a Take over freed it, so the retried turn isn’t refused from the cache for up to [HELD_ELSEWHERE_FRESH] (Codex P1 on #3899). - held_
elsewhere Some(where)when a recent answer said another instance holdsagent. The early admission check refuses on it without a network round trip.- held_
on_ another_ computer - Where the holder is when a recent relay answer put
agenton another computer (a [describe_holder] description), elseNone. - held_
on_ this_ computer_ by - The channel of another instance on this computer that, per a recent
relay answer, holds
agent— what Take over needs to find it. - holder
- Ask the relay who holds
agent’s lease, ascaller(the message’s sender, whose credentialtokenis). Cached for [HOLDER_FRESH]; “unreachable” is never cached. - holder_
on_ this_ computer - Is a [
describe_holder] description about this computer (another AgentMux instance on the same host, e.g. a second channel)? - instance_
id - This AgentMux instance’s id at the relay: host + channel. Stable across restarts of the same install, distinct between two installs on one host.