Five ways an agent can fake a green build
Agents rarely cheat on purpose, but under pressure to make tests pass they find shortcuts. Here is what to look for — and what PaneScale flags automatically.
When one agent gets stuck and another takes over, the handoff decides whether the second attempt is better or just different. Anatomy of a continuation brief.
Agents get stuck. They run out of attempts on a hard bug, they hit a usage limit halfway through a refactor, they circle around a test they don’t understand. Often a different agent gets further — different training, different habits, a fresh look.
But a fresh look is only useful if it doesn’t start from zero. The second agent needs to know what happened. In PaneScale that information travels as a continuation brief.
Not a summary of it — the task itself, with its finish line. Summaries drift; each retelling loses a constraint.
“Another agent already worked on this task in this directory and got stuck. Its changes are still here.” This one sentence changes the second agent’s behavior completely. Without it, agents tend to treat existing changes as the starting codebase and build on top of mistakes. With it, they inspect first.
The previous agent rarely got everything wrong. Asking the next one to review the existing changes, keep what is good and fix what isn’t is cheaper than starting over — and usually produces a smaller diff.
The exact output of the check that failed last. This is the most valuable part: it tells the next agent where reality disagreed with the previous attempt.
Which branch, which commit, what is uncommitted, what was committed since the task started. An agent that knows the state of the repository checks it before it continues; an agent that doesn’t may re-apply work that is already there, or revert work it didn’t recognize.
Here is the shape of a brief for an autopilot task that the lead agent couldn’t finish:
Task (unchanged):
Uploads survive a single 503 from the storage API.
Done when: npm test -- upload passes, including a new test
"retries once on 503, then succeeds"; npm run typecheck passes.
Situation:
Another agent already worked on this task in this directory and
got stuck after 2 attempts. Its changes are still here.
What to do:
Review the existing changes first. Keep what is correct, fix what
is not. Do not start over unless the existing approach cannot work.
Last failing check (npm run typecheck):
src/upload/client.ts:48:21 - error TS2322: Type 'string' is not
assignable to type 'number'.Nothing in it is clever. Every line answers a question the next agent would otherwise spend tokens and minutes rediscovering.
A handoff because of a usage limit is different from a handoff because an agent got stuck. The first agent was not wrong — it just ran out. So the brief carries more of its work forward: in PaneScale it is built from the previous CLI’s session file and the current Git state, and includes what you asked for, messages you had queued, the previous agent’s summary, its plan and task list, the files it changed, the last commands it ran, and where it stopped.
Two details make limit handoffs reliable:
The autopilot and pane handoffs keep the work in the same place. The next agent opens the same files the last one touched — no copying, no pasting, no lost changes.
The best backup is the agent most different from the lead. If your lead is good at broad changes, pick a backup known for small, careful steps — or the other way round. A handoff between two agents with the same strengths tends to get stuck in the same place.
Handoffs cost something: a second agent reading the same files, a second set of attempts. Whether that pays off shows in the morning reports. Look at the tasks that went to the backup and ask two questions:
A few nights of this tells you whether to keep the backup, swap it for a different agent, or put the effort into better tasks instead.
Often, but not always. More attempts with the same agent help when the failure was close — a typo, a missed edge case. A different agent helps when the first one keeps failing in the same way, because it brings different habits. The loop guard in the autopilot ends a task when the same failure repeats on the same state, which is the moment a handoff or a better task is worth more than another attempt.
It sees what is useful from it: the task, the situation, the previous agent’s summary and plan where they exist, the files that changed and the last failure. It does not get the full transcript, because a long transcript of an agent going in circles teaches the next one to go in the same circles.
The brief is saved as a file, so you can read exactly what the next agent receives. For a handoff you start by hand, add your own note to the new agent’s first message — one sentence from you is often worth more than a page of automatic context.
The same structure works when you hand work from one agent to another yourself, without any tool: paste the original task unchanged, add one sentence that another agent already worked on it and its changes are still in the folder, ask for a review before any new changes, and paste the last error. Four short blocks, and the next agent starts where the last one stopped instead of at the beginning.
Agents rarely cheat on purpose, but under pressure to make tests pass they find shortcuts. Here is what to look for — and what PaneScale flags automatically.
The difference between a task that runs overnight and one that wanders is usually a single sentence — the finish line. A short template and examples.
Skipping an agent’s permission prompts saves hours — and occasionally costs a lot more. When it is reasonable, and what to put in place first.