Repository navigation
feat(autopilot): the Autopilot Orchestrator agent decides; the rules only guard - #266
Merged
Merged
Conversation
…only guard
Autopilot was fixed-rule code. Now, by default (Settings › Autopilot › Decided by), an AI lead decides each time a
board's state changes: it reads every ticket with its dependencies, every task and proposed change (checks, review,
testing, findings), stuck tasks, free computer slots and its recent decisions, and returns its reasoning plus:
- which legal moves to make, in its order (prefer what unblocks the most, then nearly-done work);
- retries of stuck tasks (couldn't finish / out of fix rounds) with concrete guidance for the Coding agent;
- one precise question for a person, posted on the ticket, instead of a flat "needs a person".
Guardrails: the planner offers only legal moves (uncapped); AutopilotPlanner.WithinCaps applies the slot caps and
one-acceptance-run-at-a-time to the agent's picks; retries are bounded (2 per task); unknown ids, retries of tasks
that aren't stuck and questions about tasks that aren't stuck are dropped. It runs answer-only on the member's
computer, is asked only when the board changed (state signature), and when it can't answer the pass follows the
rules. Its reasoning lands in the Autopilot log ("Orchestrator: …").
- Domain: IAutopilotOrchestrator, OrchestratorBrief/Move/StuckTask/Decision.
- Pipeline: AutopilotOrchestratorAgent ("You are the Autopilot Orchestrator Agent" — its own routing key, distinct
from the 5-agent pipeline's Orchestrator), AutopilotSettings (Autopilot:DecidedBy, UI-first).
- Web: ProjectOrchestrator.Agent (brief, signature, guardrails, retries, questions); planner caps as parameters.
- IssueWorkPrompt: a fresh attempt carries the orchestrator's guidance, fenced as data.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
| foreach (var s in sessions.Where(s => s.Status is "Failed" or "Blocked" && s.IssueNumber is { } n && openTickets.Contains(n))) | ||
| { | ||
| var why = string.Join(" | ", repos[s.Id].Select(r => r.Error).Prepend(s.Error).Where(e => !string.IsNullOrWhiteSpace(e)).Distinct()); | ||
| stuck.Add(new OrchestratorStuckTask(s.Id, s.IssueNumber!.Value, titles.GetValueOrDefault(s.IssueNumber.Value, s.Title), |
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Autopilot was fixed-rule code — "not really orchestrated". Now, by default (Settings › Autopilot › Decided by), an AI lead — the Autopilot Orchestrator agent — decides every time a board's state changes.
It reads every ticket + dependencies, every task and proposed change (checks, review, testing, findings), stuck tasks, free slots and its recent decisions, and returns its reasoning plus:
Guardrails — the rules keep authority: the planner offers only legal moves (uncapped),
AutopilotPlanner.WithinCapsapplies slot caps / one acceptance run at a time / one move per task to its picks, retries are bounded (2 per task), and anything outside the brief (unknown ids, retries of non-stuck tasks, …) is dropped. It answers on the member's computer (no API cost), is asked only when the board changed (state signature), and when it can't answer that pass follows the rules. Its reasoning appears in the Autopilot log as "Orchestrator: …".Named Autopilot Orchestrator with its own prompt routing key so it can't be confused with the 5-agent pipeline's Orchestrator (
IOrchestratorAgent, incl. the MAF Workflow engine).Test plan
AutopilotOrchestratorTests(9): legal-move filtering + order, bounded retries / questions only for stuck tasks, non-JSON → rules, board state fenced as data, routing key, WithinCaps (slots, one test, one move per task), uncapped candidates, state signature.🤖 Generated with Claude Code
https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB