Expand description
Single-tick orchestration for the supervisor auto-approve poll loop.
Exposes poll_tick — given a broker state, a session name, a
pane-index resolver, and an AutoApproveConfig, it:
- Detects stalled agents via
super::stall::detect_stalled_agents. - Captures each stalled agent’s pane via
super::permission_prompt::detect_permission_prompt. - For safe-classified prompts, dispatches
BTab Down Enterviasuper::approve::auto_approve_pane. - For
Unknownprompts, forwards a question to the dashboard inbox so the human can resolve it.
The loop driver lives in main.rs (background thread spawned by
cmd_supervisor); this module keeps the per-tick logic pure and
testable.
Structs§
- Agent
Status Row - Subset of an agent record returned by the broker
/statusendpoint that the supervisor poll loop cares about. - Poll
Context - Inputs for
poll_tick. - Tmux
Pane Inspector - Production
PaneInspectorbacked bytmux capture-pane.
Enums§
- Tick
Outcome - Outcome of processing a single stalled agent during a poll tick.
Traits§
- Pane
Inspector - Trait providing the captured pane content for an agent.
- Pane
Resolver - Trait providing the pane-index for a given agent ID.
- Question
Forwarder - Forwarder for unsafe prompts — abstracted so tests can record forwards.
- Worktree
Resolver - Trait providing the worktree root path for a given agent ID.
Functions§
- fetch_
status_ over_ http - Fetches the broker
/statusendpoint and returns the agent summary. - poll_
tick - Runs one tick of the auto-approve poll loop and returns the outcome for each stalled agent (in iteration order).
- stalled_
from_ status - Returns the IDs of agents whose
statusis non-terminal and whoselast_seen_secondsis at or abovethreshold_seconds. - tick_
from_ status - Runs one tick driven by an HTTP
/statussnapshot rather than an in-processBrokerState.