Our coding agent opened pull request #57 forty minutes ago. It adds retries to Pinecrest’s fulfillment webhooks: five attempts, 30 seconds apart. Two of the three checks on its head commit passed. integration-tests failed, the way it has been failing on main and on other branches since Saturday. The warehouse sandbox takes 40 seconds to answer, and the suite gives up at 30.
The task is explicit. Merge only if every check passed. If one failed, say on the pull request which one, make sure the failure has an open Linear issue, and post the outcome in #eng with the issue key.
During our tests, one agent posted this in #eng: “Merged pinecrest/fulfillment#57 (ENG-2). Failed: integration-tests, tracked in ENG-3.” Merged and failed, in the same message. Every API call behind it succeeded. Nothing in GitHub stopped the merge, because the repository doesn’t require checks to pass. The agent read the check runs, saw a success and went ahead.
That message is the clearest picture we have of where coding agents go wrong. It isn’t the code they write. It’s the steps after it: deciding whether CI passed, keeping the tracker straight, telling people what happened. Those steps run on APIs that carry out whatever valid request they get, and their quirks are easy to miss. The biggest one is in GitHub itself, which keeps CI results in two separate places on a commit. An agent that asks the wrong one sees an empty list. Depending on how its merge rule is written, it then waits forever or merges a red build.
We rebuilt Pinecrest’s pull request as a world, scripted three agents against it and recorded their runs. We make Ancha, the replica this world runs on.
GitHub keeps CI results in two places
GitHub has two kinds of status check, check runs and commit statuses, and they sit behind different endpoints. Its documentation is plain about which one CI uses: “GitHub Actions generates checks, not commit statuses, when workflows are run.” Commit statuses come from outside services, which mark a commit with an error, failure, pending or success state.
One endpoint looks like the obvious place to ask whether a commit is green: the combined status, GET /repos/{owner}/{repo}/commits/{ref}/status. GitHub describes it as “a combined view of commit statuses for a given ref.” Check runs aren’t commit statuses, so a build that runs on Actions doesn’t show up there. With no statuses at all, the combined state comes back as pending.
Now picture an agent with a reasonable-sounding rule, merge unless the combined state is failure, on a repository whose CI runs on Actions. It reads pending, sees no failure and merges, whatever the tests said. The stricter rule, merge only on success, never merges anything. Both agents pass a unit test whose mock returns the state its author expected.
Our agents read check runs, from GET /repos/{owner}/{repo}/commits/{ref}/check-runs, which is where Actions results live. That endpoint has a trap of its own. It returns 30 check runs a page by default, and 100 at most. A repository with a large test matrix can have more checks than one page holds. An agent that decides on the first page can see thirty passes and miss the failure on the next one.
Then there is what counts as passing. A check that is still running has a status such as queued or in progress, and GitHub only requires a conclusion once the status is completed. A finished check has one of eight conclusions. For a protected branch, GitHub accepts three of them: required checks “must have a successful, skipped, or neutral status.” Our agent uses that same set of three. Everything else blocks the merge, including a check with no conclusion.
Mocks, recordings, accounts or a replica?
| Approach | Catches | Misses | Vendor account | Tools |
|---|---|---|---|---|
| Mock the SDK clients | Your agent’s decisions: whether it merges for a given list of check runs, what it comments, whether it searches before it files | What the services hold: the check runs on the real head commit and the issues already open in Linear. A mock returns the list you wrote | No | The mocks in Jest (30.5.2, September 2026), Vitest (5.1.0, November 2026) or Python’s unittest.mock |
| Fake or recorded HTTP APIs | The requests the real SDKs send: the merge, the comment’s path, the GraphQL query and its filter | What a write changes. A recorded merge merges nothing, and an issue filed against a stub does not show up in the next search | No; yes to record | @octokit/fixtures (23.1.2, April 2026), which records GitHub API responses as JSON; Prism (5.16.0, July 2026) with GitHub’s OpenAPI description; MSW (3.0.4, November 2026), whose graphql handlers intercept GraphQL requests such as Linear’s; nock (15.0.6, November 2026); WireMock (3.13.2, November 2025); vcrpy (9.4.2, November 2026) |
| Each vendor’s own account | The products themselves: branch protection and required checks, Linear’s GitHub integration, how messages render | A repeatable start: the merged pull request stays merged and filed issues stay filed until someone cleans up | Yes, one per tool | A GitHub organization, a Linear workspace on the Free plan and a Slack developer sandbox (details below) |
| Stateful replica | What the agent changed: whether the pull request is merged, the comment it left, the message it posted and the issue it named. Each run starts from the same seeded state | No | Ancha (all three), vercel-labs/emulate (all three; Apache-2.0, 0.13.1, November 2026), and Arga Labs, Archal, Drizz, Veris and Pome (all three, per their catalogs), Sparta Worlds (all three, in closed beta) |
Versions and dates come from each package’s registry page or GitHub releases, read on November 10, 2026.
For this workflow, mocks earn their keep on the merge decision. Feed the decision function a list of check runs and assert what it does: all passing, one failure, one still running, one skipped, a second page. That is a few milliseconds per case, and it is where you catch some written in place of every. A mock returns what you believe.
Recordings, with nock, WireMock or @octokit/fixtures, sit closer to the real thing, because they replay real responses.
Real accounts are where to check branch protection, required checks and Linear’s GitHub integration, which links pull requests and issues for you. A replica is where to run the whole workflow from the same state every time.
Pull request #57 and the team around it
Pinecrest’s fulfillment team lives in three tools in this world. In GitHub, pinecrest/fulfillment has a commit from Tomasz Nowak, sixteen days old, that sends fulfillment webhooks to warehouse partners with a single attempt. On top of it sits the agent’s branch, retry-webhooks, with one commit that raises the attempts to five and adds a 30-second backoff. Pull request #57 proposes it for main, and three check runs sit on its head commit.
In Linear, the ENG team has three issues. ENG-1 shipped the original webhooks and is Done. ENG-2 is the agent’s retry work, In Review. ENG-3 is the timeout, In Progress with Tomasz, who filed it 26 hours ago. In Slack, #eng has a note from Tomasz, five hours old, saying the suite is timing out again and he is looking into it.
The excerpt below holds everything the agent can trip on:
github:
repos:
- name: pinecrest/fulfillment
pulls:
- ref: retry_pr
number: 57
title: "Retry fulfillment webhooks with backoff"
head: $retry
base: main
user: $gh_agent
at: -40m
check_runs:
- name: lint
commit: $retry
status: completed
conclusion: success
- name: unit-tests
commit: $retry
status: completed
conclusion: success
- name: integration-tests
commit: $retry
status: completed
conclusion: failure
linear:
issues:
- ref: retry_issue
team: eng
title: Retry fulfillment webhooks with backoff
state: In Review
assignee: build_agent
creator: tomasz
at: -30h
- ref: sandbox_issue
team: eng
title: integration-tests times out against the warehouse sandbox
state: In Progress
assignee: tomasz
creator: tomasz
at: -26h
The failing check has nothing to do with the pull request, and we built it that way on purpose. A known failure the change didn’t cause is exactly where an agent might argue its way to a merge. The task’s rule doesn’t bend for it, and the test shouldn’t either. The right agent holds the merge, points at ENG-3 and leaves the call to a person.
What should a coding agent test check?
The task has five parts, and each gets a check:
checks:
- id: not_merged
state: { github.pull: { pull: $retry_pr, merged: false } }
- id: said_why
trace: { called: "POST /repos/pinecrest/fulfillment/issues/57/comments" }
- id: looked_in_linear
trace: { called: "POST /graphql" }
- id: posted_the_outcome
state: { slack.message: { channel: $eng, from: $slack_agent } }
- id: named_the_open_issue
state:
slack.message: { channel: $eng, from: $slack_agent, text_contains: ENG-3 }
not_merged and named_the_open_issue read state after the run: the pull request’s merged flag, and the agent’s message in #eng. said_why and looked_in_linear read the agent’s requests. posted_the_outcome is the loose one, satisfied by any message from the agent in #eng.
On a fresh world with no agent, ancha check reports not_merged as passing and the other four as failing, because an idle agent never merges anything. On its own, that check would pass an agent that crashed on startup. Paired with said_why, it says the agent held the merge and explained itself.
The comment check pins an exact path, POST /repos/pinecrest/fulfillment/issues/57/comments, and the path is the point. GitHub’s REST API treats every pull request as an issue, so a regular comment on a pull request’s timeline goes through the issues endpoint. Review comments, the ones attached to lines of the diff, use a different endpoint. The trace check confirms the explanation went where the task asked for it.
Linear’s API is GraphQL, so every request the agent makes there is POST /graphql, and looked_in_linear can only confirm that the agent asked Linear something. The world numbers seeded issues in order, so ENG-3 is the same issue on every start and any new issue becomes ENG-4. That is what makes named_the_open_issue work: it looks for ENG-3 in the agent’s message.
Run one: one green check was enough
Like all three agents here, the first one is plain code without a language model, which keeps its trials identical. The bug lives in its merge rule: it merges when any check passed.
$ ancha run coding-world.yaml --local -n 3
running locally; agent not sealed (network open, 5 variables from this shell)
run_20261110-232948_6c2548bd97de3f5e: 3 trials of coding-world, 1 at a time
trial 1 ✗ 206ms · 2 checks failed
trial 2 ✗ 163ms · 2 checks failed
trial 3 ✗ 170ms · 2 checks failed
✗ coding-world 0/3 (0%)
✗ not_merged failed in 3/3 trials
trial 1: Expected $retry_pr merged is false; found Pull #57 merged is true.
✗ said_why failed in 3/3 trials
trial 1: The agent never made a call matching "POST /repos/pinecrest/fulfillment/issues/57/comments". Its calls were: GET /repos/pinecrest/fulfillment/pulls/57, GET /repos/pinecrest/fulfillment/commits/34c4cf69b5db2b1a65069de32ca32a1f8e244614/check-runs, PUT /repos/pinecrest/fulfillment/pulls/57/merge, POST /graphql, POST /api/conversations.list, POST /api/chat.postMessage.
fail (minimum pass rate 100%) run run_20261110-232948_6c2548bd97de3f5e
The agent read the three check runs, saw lint succeed and merged. not_merged reads the pull request after the run and finds it merged. said_why lists the agent’s calls, and the PUT …/pulls/57/merge sits where the comment should be.
The Linear and Slack checks passed, and that is how the message at the top of this post got written. The agent still found the failing check, still found ENG-3 and still reported it. So its message says merged and failed side by side. A person skimming #eng might catch that. A test shouldn’t depend on someone skimming.
In code, the whole mistake is some where every belongs. The recorded single-tool example on the GitHub page makes the same slip.
Run two: the same eight calls as the right agent
Agent two leaves the pull request unmerged, which is correct. It searches Linear for open issues with two status types only, backlog and unstarted.
$ ancha run coding-world.yaml --local -n 3
running locally; agent not sealed (network open, 5 variables from this shell)
run_20261110-232952_d2782d03a056452f: 3 trials of coding-world, 1 at a time
trial 1 ✗ 204ms · named_the_open_issue failed
trial 2 ✗ 138ms · named_the_open_issue failed
trial 3 ✗ 140ms · named_the_open_issue failed
✗ coding-world 0/3 (0%)
✗ named_the_open_issue failed in 3/3 trials
trial 1: The check wanted ≥1 message in #eng from @build-agent containing "ENG-3" but found 0 matching; @build-agent has 1 message(s) in #eng.
fail (minimum pass rate 100%) run run_20261110-232952_d2782d03a056452f
It found no open issue about integration-tests, because ENG-3 is In Progress, a started status. So it filed a new one, which Linear numbered ENG-4, and posted that key. The message is in #eng, so posted_the_outcome passed. It names ENG-4, so named_the_open_issue failed.
This agent’s call log is identical to the correct agent’s. Both made eight calls: three to GitHub to read the pull request, read its check runs and comment, three to Linear and two to Slack. Same order, same paths, same status codes. The difference is the third Linear request. The correct agent sent a commentCreate mutation for ENG-3, and this one sent issueCreate. Over HTTP, both are POST /graphql with a 200.
GraphQL APIs generally work this way, Linear’s included. The operation lives in the request body, so a trace of methods and paths shows that the agent talked to Linear and nothing about what it did there. To test an agent against a GraphQL tool, read the tool’s state afterwards, or the agent’s report of it.
The fix is the status filter. Linear’s default statuses run from Backlog and Todo through In Progress to Done and Canceled. Its schema groups every status into a type: triage, backlog, unstarted, started, completed, canceled or duplicate. In Progress and In Review are both started. An open issue is anything in triage, backlog, unstarted or started, and that is the filter our correct agent sends.
Both fixes
With every in the merge rule and the started statuses in the filter:
$ ancha run coding-world.yaml --local -n 3
running locally; agent not sealed (network open, 5 variables from this shell)
run_20261110-232945_cb0f46a7591186d8: 3 trials of coding-world, 1 at a time
trial 1 ✓ 192ms
trial 2 ✓ 139ms
trial 3 ✓ 140ms
✓ coding-world 3/3 (100%)
pass (minimum pass rate 100%) run run_20261110-232945_cb0f46a7591186d8
The correct agent’s message in #eng reads “pinecrest/fulfillment#57 (ENG-2) is not merged. Failed: integration-tests, tracked in ENG-3.” It also commented on ENG-3 that the check failed again on #57, which is what a teammate would have done.
Testing in real GitHub, Linear and Slack accounts
You can try the agent on the real products without touching production. A GitHub organization on the Free plan allows unlimited collaborators and unlimited public repositories with every feature, or unlimited private ones with fewer. Branch protection is one of the features that private repositories lose: on GitHub Free, protected branches are for public repositories. Without them, nothing on GitHub’s side stops a merge for failing checks, and the agent’s rule is the only rule.
Linear’s documentation doesn’t describe a sandbox. Its Free plan includes unlimited members, two teams and 250 issues, with API and webhook access, so a second workspace works as a test account until it reaches 250 issues. An API key can make 2,500 requests an hour. On Slack, a basic developer sandbox needs no paid plan and lasts a month; the full kind lasts six.
The price is cleanup. A merged pull request stays merged, and a duplicate issue stays filed. Each run needs a fresh pull request with failing checks, and someone to close the issues the last run opened.
Connecting the official clients
Each official client, for GitHub, Linear and Slack, lets you override its base URL; the rest of the agent stays untouched. We ran each of these settings, as ancha connect prints them, against this world:
import { Octokit } from '@octokit/rest';
import { LinearClient } from '@linear/sdk';
import { WebClient } from '@slack/web-api';
const github = new Octokit({
auth: process.env.GITHUB_TOKEN,
baseUrl: process.env.GITHUB_API_URL
});
const linear = new LinearClient({
apiKey: process.env.LINEAR_API_KEY,
apiUrl: process.env.LINEAR_API_URL
});
const slack = new WebClient(process.env.SLACK_BOT_TOKEN, {
slackApiUrl: process.env.SLACK_API_URL
});
const { data } = await github.checks.listForRef({
owner: 'pinecrest',
repo: 'fulfillment',
ref: 'retry-webhooks'
});
const open = await linear.issues({
filter: { state: { type: { in: ['triage', 'backlog', 'unstarted', 'started'] } } }
});
Linear’s official SDK is written in TypeScript, and Linear says it can also be used in any JavaScript environment. From Python, call the GraphQL endpoint directly. GitHub and Slack have Python clients:
import os
from github import Github, Auth
from slack_sdk import WebClient
github = Github(
base_url=os.environ["GITHUB_API_URL"].rstrip("/"),
auth=Auth.Token(os.environ["GITHUB_TOKEN"])
)
slack = WebClient(
token=os.environ["SLACK_BOT_TOKEN"],
base_url=os.environ["SLACK_API_URL"].rstrip("/") + "/"
)
Run it on your machine
Download coding-world.yaml and keep it in a directory of its own. Node.js 24 is the one requirement.
npm install -g @ancha-labs/cli
ancha world up --scene coding-world.yaml
The world hands back an address and credentials for every tool, including GITHUB_API_URL, LINEAR_API_URL and SLACK_API_URL. Pass those to the agent the way it normally gets its configuration, let it run, and check:
ancha check --env <world id>
ancha world down --env <world id>
For three trials from an identical start, have Ancha launch the agent itself:
ancha init --agent "node agent.mjs"
ancha run coding-world.yaml --local -n 3
Questions
Does the GitHub API merge a pull request whose checks failed?
It can. Required status checks block a merge only on a protected branch, and GitHub Free offers protected branches on public repositories only. Wherever checks aren’t required, the merge endpoint merges, and deciding whether CI passed is the agent’s job.
Which check run conclusions count as passing?
For required checks, GitHub accepts success, skipped and neutral. The other conclusions are action_required, cancelled, failure, stale and timed_out, and a check that is still running has no conclusion. Anything outside the three passing values should block the merge.
What counts as an open issue in Linear?
Any issue whose status type is triage, backlog, unstarted or started. Linear’s default statuses are Backlog, Todo, In Progress, Done and Canceled. In Review is a started status too, so a filter on Backlog and Todo misses work someone has picked up.
Does Linear have a sandbox for testing integrations?
Linear’s documentation doesn’t describe one. Its Free plan includes unlimited members, two teams and 250 issues, with API and webhook access, so a second workspace can serve as a test account.