Build Health
Last reviewed November 13, 2026 (QA handoff checked against the app).
Build Health is an Engineering dashboard section that summarizes the linked GitHub repositories for one company. It is not a standalone top-level page.
Open Build Health
- Open Companies.
- Select a company with the Engineering capability enabled.
- Open the Engineering capability tab.
- Choose Overview and find Build Health.
What it shows
For each discovered repository, CPLai can show:
- repository identity and default branch;
- the five most recent GitHub Actions workflow runs, with status, conclusion, and links back to GitHub;
- the five most recent commits on the default branch, with author and links back to GitHub.
Open pull requests are not counted here; see the Merge queue section below Build Health in the same Overview, or the PR mailbox.
The section reflects GitHub's current data at refresh time. A green workflow does not prove that unpushed local changes build successfully.
Connect GitHub
Build Health uses a GitHub credential available through the company's Keychain configuration. Create or select the appropriate GitHub token, scope it to the company, and make sure it can read the repositories and Actions metadata you expect CPLai to display.
Use the least privilege needed. A read-only token is sufficient for health reporting; write permissions are only needed for separate Git operations that require them.
Refresh and interpret results
Choose Refresh in the Engineering dashboard to request new company health data. Distinguish these states:
- successful: the latest reported workflow completed successfully;
- failed/cancelled: GitHub reported that conclusion;
- in progress/queued: the workflow has not finished;
- unknown/no runs: CPLai could not find an applicable workflow result.
When the merge branch goes red
A repository can let pull requests merge on their own passing CI without re-running it on the latest merge branch. That keeps many pull requests a day moving, and the CI run on the merge branch after they land is what tests them together.
CPLai watches that run for every connected repository. When the newest finished commit on the merge branch fails, CPLai files one bug ticket. It lists the failed runs and the pull requests merged since the last passing commit, which are the likely causes. When a newer commit passes, CPLai comments on the ticket and closes it.
When a pull request's own CI fails
CPLai's PR doctor checks the open pull requests of every connected repository every 10 minutes. It acts on pull requests that belong to a CPLai ticket, the same ones that move their ticket to in review when they open, and on dependency updates from Dependabot or Renovate.
Dependency updates have no ticket of their own. When one of their checks has failed for 30 minutes, PR doctor opens a ticket for it on the company's board, assigned to an engineer from the company's engineering team, and treats it like any other ticket from then on. If the update fixes open Dependabot security alerts, the ticket is a security ticket that names them, with their severity. When the pull request merges, the ticket is done; when it is closed without merging, the ticket is cancelled. Cancel the ticket yourself to make PR doctor leave that pull request alone. A conflicted or pending update gets no ticket, since the bot rebases its own pull requests.
A draft pull request is left to its author until its ticket moves to in review. From then on PR doctor treats it like any other, because nobody else is working on it.
Blocked or cancelled tickets are skipped. PR doctor does not rerun their jobs, reassign them, or start an agent on them. Resolve the human decision or approval recorded on a blocked ticket before returning it to an active status. An agent pause also remains in effect when PR doctor assigns work.
- A job was cancelled or never started, usually a CI runner problem: CPLai re-runs those jobs once.
- The CI machine refused to run a job: it failed in the runner's own setup, before any step of the workflow ran, for example because the machine's memory guard found too little free memory. Nothing in the pull request needs fixing, so CPLai starts no agent and leaves the ticket alone. It re-runs those jobs once an hour, so the pull request goes green on its own once the machine has room. If the jobs are still refused after 3 re-runs, CPLai lists the pull request on one blocked ticket in your inbox per company, asking you to free room on the machine. Later pull requests held up the same way are added to that ticket instead of filing more.
- A check failed, or the branch conflicts with its base: CPLai waits 30 minutes so whoever pushed it can fix it first. Then it moves the ticket back to to-do, comments with the failed checks and their error lines, and starts the ticket's agent on the fix. A paused agent picks it up when it resumes.
- Each new push that fails again is the next attempt. So is a failure that gets no new push for 4 hours after a comment.
- After 3 attempts, CPLai hands the ticket to an engineer from the company's engineering team and starts them. It looks in the agent's own team first, and prefers developers. A ticket held by a terminal session, which CPLai cannot start, goes straight to an engineer.
- If the engineer's 3 attempts also fail, CPLai labels the pull request
ci-stuck, blocks the ticket, and stops.
A War Room for a pull request in trouble. While both War Rooms switches in Settings -> Automation -> War Rooms are on, PR doctor opens a War Room for a failed or conflicted pull request instead of starting the ticket's agent on its own. Opening a room for a pull request in trouble is on by default. Letting War Room agents start real work is off until you turn it on. The room seats the company's Head of Engineering to assess, the ticket's agent (or the engineer PR doctor handed the ticket to) to fix, and a Deployment Engineer to verify. PR doctor posts the failed checks and their error lines in the room, with any secret masked, and the team works the problem in turn. The ticket comment and the attempt count work as described above. A later failure reuses the same room. The room closes when PR doctor sees that the pull request merged or closed; while PR doctor is turned off, the room stays open until someone selects Close room in it. If no one in the room can start (for example an agent at its spending limit or turned off), the room says so and PR doctor handles the fix as described above, with a comment that says why. While either switch is off, PR doctor works exactly as described above. See Incidents - War Rooms.
PR doctor is on by default and has no switch on the Settings page. To turn it off, an administrator sets the pr_doctor_enabled settings key to false, for example with PUT /api/settings and the body {"pr_doctor_enabled": "false"}. The repository's token needs permission to re-run workflows and label pull requests, and to read Dependabot alerts for security tickets to name them.
Land pull requests from chat (Merge Desk)
The PR mailbox shows a Land PRs button for each company with open pull requests, on the desktop app and the web dashboard. It opens that company's Merge Desk chat in the sidebar, and the same conversation shows full screen on the agent chat page. A new or quiet conversation starts by asking what is ready to land.
- It knows your rules. The desk lists every open pull request with its verdict (ready, running, red, conflict or draft), merges the ones you say, then ships them the way each repository ships. It reads deploy steps from the repository's own instructions, CPLai knowledge and its memory, and asks you once when none of them say.
- It merges only fully green pull requests. A merge goes through CPLai, which re-reads GitHub first. CPLai refuses unless the pull request is open, not a draft, still on the exact commit the desk checked, free of conflicts, and every check on that commit passed. The merge itself uses the company's owner token. Check results are read with the agent bot entry linked to that company when there is one, or the owner token when there is not. If that read fails, the checks count as unknown and CPLai does not merge. Those merges use your admin bypass of the review rule, and each one is recorded in the audit log and on the pull request's ticket.
- Only you can talk to it. The desk takes messages only from a person signed in to the dashboard or the desktop app who is an admin of the company. Other agents are refused. Its merge permission comes from your own chat message and expires after a few hours; if the desk reports that its calls are failing, reset the session from the chat header and send a message.
- One desk per company. It is an agent named "Merge Desk (company)" that never runs on a schedule. It works from the company's oldest project folder.
Merge train
A merge train lands many pull requests with one CI run instead of one run each. Every few minutes CPLai collects the pull requests that are ready, merges them together on a train/ branch cut from the merge branch, and lets CI run once on that branch.
- Green: CPLai merges each pull request, exactly as it was tested, and deletes the train branch.
- Red: CPLai merges nothing and retries the first half of the batch, halving again until it finds the pull request that fails. That pull request gets a
merge-train-blockedlabel and a comment, and stays out until new commits are pushed to it. - Merge branch red: trains wait until it passes again, so no pull request is blamed for someone else's failure.
A pull request rides the train when it is not a draft, has no merge conflict, and has all of its own checks passing. With Require QA sign-off on (the default), its ticket also needs a green QA review for that exact pull request and head commit. The review must come from the ticket's assignee, signed in with its own agent credential and designated as a QA reviewer for the ticket's project, and it must name that project's own GitHub repository: the one set on the project, or else the project folder's git remote. A review for another repository never counts, even in the same company, and a review stops counting if the project's repository changes. Comment text such as QA-GATE: APPROVED or PARITY VERIFIED is discussion only. CPLai tells every QA agent how to submit a review, whatever skill the agent uses. CPLai finds the ticket from the branch name (feature/<ticket id>-...) or a CPLai ticket id in the pull request description. Pull requests that change CI workflows, CI scripts, or deploy scripts are left for a person to merge, as are ones labeled hold or do-not-merge.
Turn the train on for a project
The train is off until you turn it on. Open the project's settings (Project Settings on the desktop app, the Git tab on the web dashboard) and use the Merge train section:
- Set Merge branch to the branch the project's pull requests merge into, for example
main. This also starts the red-tip watch, which files a ticket when CI on that branch goes red. - Turn on Run the merge train. The train runs on the computer that serves the dashboard, so two CPLai installs never run trains on the same repository.
- Leave Require QA sign-off on unless the project has no QA agent.
- Under QA reviewers, tick the agents whose reviews should count. You can choose more than one. Only the owner, signed in to the desktop app or the dashboard, can change this list.
Choose QA reviewers
With Require QA sign-off on, the train accepts a QA review only from an agent on the project's QA reviewers list. The list shows the company's agents, with QA roles first.
- Nobody chosen: the section warns that no pull request can ride. The train still runs, but it lands nothing until you choose a reviewer or turn sign-off off.
- More than one reviewer: a review counts from a chosen agent only while that agent is the ticket's assignee. CPLai checks assignment when the review is posted and again when deciding whether the pull request can ride.
- No QA agent in the company: add one and choose it, or turn Require QA sign-off off. With sign-off off, the train lands any pull request whose own checks pass, with no review.
- Removing a reviewer also stops that agent's earlier reviews from counting, because the list is checked each time the train looks at a pull request.
Your owner GitHub token covers every project, so no extra Keychain entry is needed. A repository with its own GitHub entry can still turn the train on in that entry's metadata ("merge_branch", "merge_train": "<computer name>").
The train uses each repository's own CI:
- Your CI must run on train branches. Add
train/**to the push branches of the workflow that tests the merge branch. Until then the status line says so, and no train is built. - A train passes every job your CI runs on train branches, and every required check. CPLai reads the jobs from your workflow files, so editing a workflow does not stop the train until a new run finishes. When a batch itself changes a workflow, the train is checked against the jobs in that changed file. Jobs that never run on a push, such as a manual-only job, are left out. If a job's name cannot be read from the file (a matrix job, a call to a reusable workflow, or a name built from an expression), CPLai takes that workflow's job names from its newest green run on the merge branch or on a train branch instead. The merge branch's required checks always count too, except those only a pull request workflow produces (next point). A train touching only files your CI ignores (its
paths-ignore) lands on its pull requests' own checks. - Checks that only run on pull requests are checked on each pull request. Some required checks describe a pull request, not the code, such as a limit on how many commits it adds, and only a
pull_requestworkflow produces them. A train cannot show those, so each pull request must show them passed on its own latest commit before it rides. Any other required check that no train workflow produces still stops the train, and the status line names it.
The status line under the switches shows what the train last did: idle, testing a batch, landed, blocked on a failing pull request, paused because the merge branch is red, or why it cannot run. The token needs permission to push branches and merge pull requests. The train reads check results the same way as the Merge Desk. If the token cannot read GitHub checks, link an agent bot entry that can read them to the company.
How do I hand a pull request to QA?
- Link the pull request to its CPLai ticket, and check that the ticket belongs to the correct company and project.
- Put the ticket in In Review and assign it to an agent selected in the project's QA reviewers list.
- Include the PR link, the full head commit, what changed, and the checks already run in the ticket comment.
- Ask the assigned reviewer to test that commit and submit a structured QA review on the ticket. The review identifies the repository, PR number, full head commit, and a verdict of
green,block, orhold. - Check the merge queue's QA result. A valid green review shows QA ok; a block or hold shows QA failed; missing or outdated evidence shows QA pending. no ticket means CPLai could not link the PR to a ticket.
The reviewer submits this evidence through the agent review workflow. Typing an approval into the ordinary comment box, or approving the PR on GitHub, does not create CPLai's structured QA evidence. Use comments to explain the result and link the test evidence.
Tip: A new push changes the commit being reviewed. Ask for a fresh review of the new head. Keep the reviewer assigned while waiting for the train: changing the assignee, removing the reviewer, or changing the project's repository can stop the earlier approval from counting.
How do I tell whether a merged feature is available?
The train lands code in the configured merge branch. Publishing and installation follow the repository's separate release process. A green train or a merged PR does not establish which build a user is running.
For CPLai itself, compare the release information with Settings -> About & updates -> App updates -> Installed build in the desktop app. See Roadmap - release stages and Getting Started - app updates.
Troubleshooting
A repository is missing
Confirm the project belongs to the selected company, its repository is connected, and the GitHub credential can see it.
Authentication fails
Check the Keychain entry's type, company scope, token validity, and repository access. See Keychain.
Results look stale
Refresh the section and compare the workflow directly on GitHub. If GitHub is current but CPLai is not, check System Status and the service logs.