Repository navigation
supervisor: A scheduled health supervisor that keeps the controller working #626
Copy link
Copy link
Closed
Labels
Description
From the operator (cgwalters), 15 Oct, verbatim:
you know what I think we need is to create a supervisor.yml poller agent whose job it is just to monitor health and ensure the controller is working, it's almost what you're doing now. This should be highly privileged (as you are, full cgwalters-bot token, arbitrary writes) but should only take direct action when it needs to?
What it replaces. The interactive controller session, which today does the following by hand:
- re-runs work that failed in an infrastructure outage, and clears the
needs-humanlabels and the coordinator failure counts the outage caused; - cancels duplicate or misrouted dispatches, and closes duplicate PRs;
- closes issues that a merged PR finished without closing them;
- notices merge-queue failures and dispatches fixes;
- pauses the scheduler when it misbehaves;
- notices loops (the coordinator re-planning, Mistral runs ending with nothing) and dispatches the fix;
- reads the operator's decisions and acts on them.
Design.
supervisor.yml, scheduled every 15 minutes. A deterministic health pass runs first, with no agent. It writes a health report (JSON) with checks like these:- consecutive poll failures;
- runs stuck past their timeout;
- the broker unreachable (from the probe);
- coordinator epics looping, stale, or failing N times;
- scheduler dispatches whose issue is closed, already has a PR, or is an umbrella;
- merge-queue removals;
- approved PRs sitting unmerged;
needs-humanlabels whose cause was infrastructure;- Dependabot PRs failing the queue;
- unanswered decisions;
- the release pin lagging behind the latest agentic-job release.
- The agent runs only when a check fails (or once a day for a sanity pass). It gets the report and a playbook, which is this list written as procedures, and acts.
- Privilege. The operator asked for the bot's full token and arbitrary writes. The risk is that the agent reads text other people can write: PR bodies, issue comments, run logs of runs that processed untrusted repositories. Text like that could instruct it to do things. Mitigations, whatever the token:
- its inputs are the health report plus content written by cgwalters-bot or the operator; anything else is passed to it as quoted data;
- every action it takes is logged as one line, with a link, in one supervisor issue in the private operator repository;
- anything irreversible (deleting things, force-pushing, changing settings outside an allowlist of variables) goes to the operator as a decision instead.
- Its own health. The review site's controller panel shows the supervisor's last run, so a dead supervisor is visible (review#73's staleness flag).
Generated-by: https://github.com/cgwalters/#llms
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Oct 15, 2026
✅ dispatch ended well and opened pull request #653. Result: #653
cgwalters-bot commentedon Oct 16, 2026
Decision (operator, 16 Oct, D14): A, broad typed actions. The supervisor agent asks for actions from a wide, typed list. A small executor job, which holds the bot token, performs them. The token never enters the agent's environment, and anything off the list comes to the operator as a decision.
The list:
BOARD_DISPATCH,COORDINATOR,RUNNER_EGRESS_TRACE, …);bot-runs dispatchwith kind and pool);Build steps 2 to 4 of this issue on top of the health pass (#629):
Tests cover the executor's validation: an unknown action, a variable outside the allowlist, a repository outside the org, and a malformed target.
Generated-by: https://github.com/cgwalters/#llms
cgwalters-bot commentedon Oct 16, 2026
Generated-by: https://github.com/cgwalters/#llms
cgwalters-bot commentedon Oct 16, 2026
Dispatched the plan in #626 (comment): run. Run independently: no open pull request of cgwalters-bot changes a path it names.
supervisor: Run the health pass, and let an agent ask a validated exe…