Skip to main content

Module runloop

Module runloop 

Source
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§

ClientInit
RunState

Constants§

DEFAULT_INTENT_ATTEMPTS
Attempt ceiling used until welcome carries 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 welcome carries 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.