Preflight and retries
Run pinned checks, set a command failure limit, and recover when a check needs your input.
What preflight does
Preflight is the agent’s workflow for finishing an issue: read its required checks, fix failures, submit evidence, publish the result, and follow the configured pull request checks. The repository’s pinned closeout policy determines what is required.
The host validates evidence and enforces the checklist. The agent runs the commands, reviews their output, and makes repairs. The workflow uses the commands and review tools chosen by the repository; it does not require a particular package manager or review service.
Add repository instructions
Use either or both sources for a repository-specific closeout prompt:
- Commit
.acpdash/closeout.mdto the default branch to keep instructions with the repository. - Open Repository settings, select the repository, enter an Additional closeout prompt, and save the defaults. This prompt is stored on that host.
For example:
Run the project's verification skill before reporting done.
Open the running dashboard and exercise the changed flow.
Publish screenshots of the loaded app and the relevant API or test results.
Do not use a loading screen as proof that the dashboard works.
Agents receive the file first, followed by the dashboard prompt, through get_closeout_instructions and check_closeout. Both apply. An issue reads the file from its pinned base commit, so worker edits cannot replace it. Dashboard edits apply on the next closeout check, including for existing issues. Each prompt accepts up to 20,000 characters; clearing the dashboard field leaves the committed file in effect.
A prompt tells the agent what to do. It does not prove the work happened or add an enforced gate. Use .acpdash/closeout.yaml command, receipt, or visual-proof items for requirements that must block completion.
Set a command failure limit
Add .acpdash/closeout.yaml to the repository’s configured base branch before starting the work:
version: 1
retry:
maxFailedAttemptsPerItem: 5
items:
- id: checks
kind: command
phase: done
run: bun run check
hint: Fix the failing checks and rerun this item.
Use your repository’s check command in run. This example allows five failed executions of each required command item before asking for your input. maxFailedAttemptsPerItem accepts an integer from 1 to 20. Five is an example, not a default: omitting retry leaves command attempts unlimited by the host.
The policy format remains version: 1. Without a policy file, the host adds no extra closeout checks. Cucumber runs are required only by explicit kind: cucumber items.
The host pins the policy, including its retry limit, to each issue revision from the base commit. Editing it in a worker’s branch does not change that revision’s requirements. To change an active issue’s policy, update the base policy and use feedback and approval to create a new issue revision.
Run the checklist
- The agent calls
check_closeoutto read the pinned requirements. - For each required command, it calls
start_commandwithissueId,revision, anditemId, then inspects the completed command’s status and output. - It fixes clear failures within the approved scope and reruns the affected checks. If the expected behavior or scope remains uncertain after investigation, it asks you for a decision.
- It submits recorded checks with
submit_issue_checks, or Cucumber Messages withsubmit_closeout_cucumberfor required Cucumber items. It publishes screenshots and other artifacts withshare_proof. - A child agent pushes its tested commit and opens its pull request before
report_item_result. A main agent’s direct quick-work result does not require a pull request.
Running the same command in an ordinary shell does not satisfy a pinned command item. The host needs the command record tied to the issue, revision, and item. A new implementation commit also needs fresh proof for requirements tied to a commit.
What counts as a failed attempt
The limit is tracked separately for each pinned command item in the current issue revision and retry round. Each command execution counts at most once, and the counts survive a host restart.
| Event | Effect on the count |
|---|---|
| A pinned command finishes with a nonzero exit code | Adds one failed attempt. |
| A command is stopped or interrupted by a host restart | Does not add a failed attempt. |
| A command exits zero | Does not add a failed attempt or erase earlier failures. |
| A command exits zero but its commit changed or its worktree is dirty | Does not add a failed attempt; it still cannot provide valid passing evidence. |
| A new commit, pull request comment, ordinary chat message, or unrelated answer | Does not reset the count. |
| A receipt check, Cucumber submission, independent review, CI observation, or review-thread poll | Does not consume this command allowance. |
Command output stays in the existing command history. Proof artifacts are published separately by the agent.
Recover from an exhausted check
The Closeout checklist shows the count, for example 5 of 5 failed attempts, 0 remaining. At the limit, the host refuses another start for that item and asks a question in Needs you.
Write corrective feedback as your own answer to that exhaustion question. A nonempty answer restores the full configured allowance for that item before the host delivers your feedback to the agent. In this example the checklist returns to 0 of 5 failed attempts, 5 remaining. There is no separate attempt-grant step.
Choosing Pause or Stop leaves the check exhausted. When you want to continue, explicitly resume the agent to reopen the exhaustion question, then answer it with corrective feedback. Resume alone does not restore attempts. An old question from a previous issue revision or assignment cannot restore the current allowance.
A project pause, another unanswered question, or a pending permission can still hold work after the allowance is restored. Restoring attempts does not make a failed check pass or accept the result.
Follow pull request feedback
After reporting a result, the agent still follows the configured CI and review requirements. It reads comments, logs, relevant code, and tests before deciding what to change. Clear fixes within scope can proceed; a real uncertainty about behavior, the choice of fix, or approved scope needs your answer. Non-actionable acknowledgements need no change.
The host waits for all CI checks to finish, then for a quiet period without a changed check, review, substantive comment edit, or general pull request comment. The default is 15 minutes (900 seconds), and a fresh poll must confirm that the full quiet period has elapsed. A comment that arrives hours after the push starts that full quiet period again. The handoff includes actionable feedback, failing CI, and unresolved review threads. Informational comments stay on the issue and do not wake the worker. The host’s own posted replies do not start another batch.
After a fix changes the commit, the agent reruns the affected verification and submits fresh proof. Earlier evidence stays in history. See verification and proof for acceptance requirements.
Get the agent guide
Set PR feedback wait (seconds) in Repository settings to allow more time for reviews to arrive. For example, 1800 waits 30 minutes after the latest change. Leave it blank to use 15 minutes (900 seconds). The same setting can be committed in .acpdash/closeout.yaml alongside version and items:
pullRequestFeedback:
quietSeconds: 1800
mode: ask # ask or yolo
suggestions: act # act, record, or ask
blockAt: never # P0, P1, P2, P3, or never
severityMap:
critical: P0
blocker: P0
high: P1
medium: P2
moderate: P2
low: P3
nit: P3
p0: P0
p1: P1
p2: P2
p3: P3
mode chooses Ask first or YOLO. Ask first is the default. YOLO lets the assigned agent decide feedback tradeoffs and post GitHub replies through the host. An unknown mode is a configuration error and does not enable YOLO. Each field uses the issue’s pinned YAML when that field is present, then the repository setting, then the application default. Omitted YAML fields keep the repository value. A configured severityMap replaces the whole default map. Labels left out of that map have no priority, so keep p0, p1, p2, and p3 in the example when those reported labels should still map. Quiet seconds are whole numbers from 0 to 86400. Zero removes the extra quiet period; CI must still finish and the observation must be fresh.
Ask first still lets the agent fix a valid in-scope problem without another permission. A scope question offers Fix now, Defer, and Dismiss only. Defer keeps the proposed follow-up in the decision history and does not start that work. A facts or product question uses the options the agent supplies and your free-text answer. YOLO may ask for a missing fact or access, and it does not ask you for a product or scope judgment. Switching a current repository or pinned mode to YOLO lets an eligible agent reconsider open scope and product questions without an invented answer. A facts question stays open. Paused, stopped, and accepted work stays where it is. A pinned policy from another revision does not grant YOLO. The issue stays on Ask first, so a necessary scope or product question is still asked, and suggestions: ask still waits before a suggestion is adopted. An authorized YOLO grant decides that suggestion and records the reasoning. Approving a decision does not approve a GitHub reply: the reply needs the exact displayed text, destination, head, and context. A reply whose delivery is uncertain stays unsent until a fresh check finds the posted comment. Neither mode clears a failing check, a blocking review, an unresolved thread, missing proof, or a configured severity blocker. Defer and dismiss do not clear that blocker. A provider shell that does not use the host reply operation may still reach GitHub under trusted execution. The optional CLI sandbox restricts command execution; it is not a complete process or credential boundary.
Agents can call get_closeout_instructions to retrieve the canonical preflight and pull request feedback instructions from the host. The text comes from the closeout section of the host operating guide, so providers can retrieve it even without discovering a local skill.
The host includes closeout guidance when assigning implementation or handling closeout feedback. See agent operating instructions for onboarding and updates.