Expand description
Foreground role runtime: one authenticated server link, four tasks, and the adapter socket that keeps serving plugins across reconnects.
The transport handles death and redialing behind one handle, so this loop
follows its readiness. Every pass from Reconnecting back to Ready runs
the order the plan fixes for a reconnect: welcome, intent flush, event
resume, pull.
Structs§
Constants§
- DEFAULT_
INTENT_ ATTEMPTS - Attempt ceiling used until
welcomecarries the role’s own value. - EVENT_
CURSOR_ KEY - Key holding the durable event cursor in
config_cache. - FLUSH_
PAUSE_ MS - Pause between intent flush passes.
- NOT_
READY_ PAUSE_ MS - Retry delay for a request that the transport answered
NotReady. - OUTCOME_
POLL_ MS - Poll cadence for terminal facts emitted by a self-driven session backend.
- PULL_
HOLD_ MS - Long-poll window the client asks the server for.
- PULL_
LIMIT - Deliveries drained per pull.
- PULL_
PAUSE_ MS - Pause between pull attempts that returned nothing.
- READINESS_
POLL_ MS - Poll interval for the readiness watcher.
- RECONNECT_
LADDER_ SECONDS - Reconnect ladder in seconds (§6: 1/2/4/8/16/32/60).
- SHUTDOWN_
CLOSE_ BUDGET - Bound on the session sweep the SIGTERM/SIGINT handler runs, short enough that an operator’s own grace period still sees the process leave.
Functions§
- accept_
path - The local accept path for the current role slice.
- acp_
options - The
[acp]table in the shape a session backend can read without a config dependency. The only decision made here is the one the backend acts on: the permission word, already validated by the config loader, becomes whether this client grants an agent’s request. - default_
intent_ backoff - Ladder used until
welcomecarries the role’s own values. - reconnect_
backoff - Reconnect ladder as durations, capped at the last rung.
- run
- Run the role runtime until a permanent handshake failure or a dead local surface stops it.