Ask @cargo on a Pull Request in Your Go-to-Market Repository
To have @cargo answer on any pull request in your go-to-market repository, install the Cargo GitHub app on the repository, deploy a Cargo coding agent bound to it, and turn on “All pull requests” on the agent’s GitHub trigger. A comment that mentions @cargo then wakes the agent, which works on that pull request’s branch and pushes its change there as a new commit instead of opening a second pull request.
Without the setting, an agent only answers on the pull requests it opened itself. The setting shipped on 2026-09-29.
What you need #
- The Cargo GitHub app on the repository. The agent acts as the app, only on repositories an admin installed it on: install it here. Connecting GitHub in Cargo does not install the app; the two are separate.
- A Cargo project of the workspace connected to the repository, which is how the workspace proves it owns it: see connect a repository.
- An LLM connector for the coding harness, for example Anthropic.
- A Cargo project in the repository, so the agent is declared and deployed from the same checkout.
cargo-ai project init <dir>creates one.
Declare the agent #
import { agentNativeTrigger, defineAgent } from "@cargo-ai/cdk";
import { anthropic } from "../connectors/anthropic";
export const reviewer = defineAgent("reviewer", {
harness: "claudeCode",
connector: anthropic,
languageModel: "claude-sonnet-5",
systemPrompt:
"Work on this go-to-market repository when someone asks on a pull request.",
// state omitted: plan and deploy bind this project's connected state
triggers: [
// The project's pull requests: the native agent `state`. On GitHub its
// events arrive through the Cargo GitHub app, so no connector.
agentNativeTrigger({
agentSlug: "state",
config: { allPullRequests: true },
}),
],
});
harness can also be codex or openCode. Leaving out state binds the agent to the project cargo.state.json points at when you plan and deploy, so it clones that project’s repository, directory and production branch, and that repository is the boundary for every mention the agent answers. state: stateRef("<uuid>") names another project of the workspace, and env and runAs set the agent’s environment variables and the service user it runs as.
cargo-ai project plan # prints the binding, e.g. agent:reviewer bound to this project's state <uuid>
cargo-ai project deploy
Then, on any pull request in that repository, comment:
@cargo the scoring play still reads the old employee-count column. Fix it on this branch.
The app answers to @cargo, @cargo-ai and its own handle, @cargo-hq. The agent clones the pull request’s head branch, does the work, pushes to that branch, and answers in the thread.
Who answers which mention #
| Situation | Who answers |
|---|---|
| Mention on a pull request an agent opened | that agent alone |
| Mention on any other pull request in the repository | every agent bound to it with “All pull requests” on |
| Mention on a pull request whose opening agent was deleted | falls through to the repository’s agents |
| Repository no Cargo project is connected to | nobody |
| Pull request from a fork | nobody |
| Checks fail or a review lands | only on pull requests the agent opened, and only if enabled |
The chat that opened a pull request keeps it, so nothing is answered twice. A fork’s pull request is refused because its branch lives on the fork, which the app can neither clone nor push to. A repository no Cargo project is connected to is refused because no workspace has proved it owns it: only the workspace that connected one answers there.
The other trigger settings #
Three more settings sit on the same trigger. They concern only the pull requests the agent opened, because acting on a stranger’s pull request when nobody asked is not a request:
| Setting | Config field | What it does |
|---|---|---|
| Fix failing checks | fixFailedChecks | Wakes the agent when CI fails on its pull request, so it can push a fix |
| Attempts per pull request | maxCheckFixAttempts | How many fixes in a row before it waits to be asked: 1 to 10, default 3, reset by a mention or a review |
| Address reviews | addressReviews | Wakes the agent when someone requests changes or comments on a review |
All three are off by default, as is allPullRequests.
Why a go-to-market repository #
When plays, models, agents and company context live in a repository, a pull request is where a go-to-market change is reviewed, and the person reviewing it is the one who notices what is wrong. Asking on the pull request puts the fix in the same diff instead of a separate ticket. The setup for driving Cargo from a coding agent on your own machine is in run go-to-market from Claude Code, and the operating model is in run go-to-market with coding agents.
Frequently asked questions #
Check four things. The Cargo GitHub app must be installed on the repository. A deployed Cargo coding agent must be bound to that repository. Its GitHub trigger must have “All pull requests” on, unless the agent opened the pull request itself. And the pull request must not come from a fork, and a project of the agent’s workspace must be connected to the repository.
No. It clones the branch of the pull request it was mentioned on and pushes its change there as a new commit, including on a pull request someone else opened.
No. Fixing failing checks and addressing reviews only apply to pull requests the agent opened, and only when those settings are on. On any other pull request it acts only when someone mentions it.
Yes, on a pull request no agent opened: every agent bound to the repository with “All pull requests” on answers. On a pull request an agent opened, that agent answers alone.
Build this workflow instead of reading about it.
Cargo is the GTM infrastructure your coding agent builds on: enrichment, scoring, routing and outreach, defined in code and run in production.