Add fix-ci mode: fix CI failures from PR check annotations#1
Merged
Conversation
New 'autopilot fix-ci --pr <N>' command that lists failed CI checks, lets
the user select which to fix (interactive or --checks flag), fetches
structured failure annotations via the GitHub check-runs API, and loops
an agent to fix, push, poll CI until the selected checks pass.
Architecture:
- BaseOrchestrator extracted with shared run(), _run_agent_with_retry(),
_do_verify_push(). Existing Orchestrator inherits unchanged behavior.
- New CIOrchestrator: FETCH_ANNOTATIONS, FIX_CI, VERIFY_PUSH, WAIT_CI.
- Uses /check-runs/{id}/annotations API (compact, structured) instead of
raw logs (huge, slow on large repos).
- Deduplicates annotations across checks by (path, start_line).
- Strips ANSI escape codes and filters generic noise.
- Excludes *-results aggregation gate checks automatically.
New functions:
- github_api: get_failed_checks, get_check_annotations, get_check_states
- prompts: fix_ci_prompt, format_ci_annotations_for_prompt
- persistence: task_mode + ci_check_names columns (schema v3 migration)
- config: ci_check_names, ci_poll_interval_seconds, ci_poll_timeout_seconds
- cli: fix-ci subcommand, _run dispatches by task_mode
18 new tests (83 total), all passing. Zero regressions.
This was referenced Mar 17, 2026
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.
New 'autopilot fix-ci --pr ' command that lists failed CI checks, lets the user select which to fix (interactive or --checks flag), fetches structured failure annotations via the GitHub check-runs API, and loops an agent to fix, push, poll CI until the selected checks pass.
Architecture:
New functions: