Skip to main content

Module reactor

Module reactor 

Source
Expand description

Central event-drain and wake-action policy — mode-agnostic engine layer.

drain_event_queue pops every pending event from the queue in priority order, formats it, and classifies it as Steered / Buffered / Injected. wake_action decides what the caller should do next.

event_payload_from_drained builds the canonical wire-format payload (shared by RPC and server) from a DrainedEvent.

Structs§

DrainedEvent
A single event that was drained, together with its formatted payload and how it was handled.
EventPayload
Canonical runtime event payload carried by RpcEvent::Event. Server mode internalizes the same formatted event into its owning conversation rather than exposing a raw transport frame.

Enums§

EventDisposition
What happened to a single event that was drained from the queue.
WakeAction
What the caller’s event-loop arm should do after drain_event_queue + wake_action.

Constants§

AUTO_TURN_CAP
Hard cap: how many consecutive auto-triggered model turns can fire before the engine parks and waits for real user input.

Functions§

claim_auto_turn
Centralised auto-turn claim gate.
drain_event_queue
Drain every event currently in queue.
event_payload_from_drained
Build the canonical EventPayload from a DrainedEvent.
idle_should_wait
Returns true when the agent idle loop should park on queue.notified() instead of immediately nagging with a user message.
spawn_prompt_registration_check
Pure decision logic for the spawn_prompt registration re-check (Bug 1 fix).
terminal_flush_seam
Pure decision logic mirroring terminal_flush from cmd/rpc.rs for use in integration tests.
wake_action
Decide what the caller should do after draining the queue.