GuidesUpdated

Which coding-agent session introduced this regression?

Trace a reproducible bug through the running build, Git history, pull request and agent session, then assign a bounded fix to the right agent.

On this page

A feature breaking after an agent's work is a lead, not proof. Reproduce the failure in a known checkout, find the change that caused it, read the PR and diff, and only then look for the session that wrote it.

Canopy Git and agent workspace used to inspect a changed project
Canopy Git and agent workspace used to inspect a changed project

Freeze a reproducible report

Record the failing action, expected and actual result, environment, branch, commit and first error. Confirm the server behind the page belongs to that checkout. For a production-only bug, note the deployed revision first. With several agents active, a session title or timestamp is weak evidence. Keep logs, but don't paste secrets into a prompt. Aim for one repeatable failure and one known-good comparison.

Find the change in Git

Start with the affected file and recent commits, then read each candidate diff. Git blame shows the commit that last touched a current line. It doesn't prove causation and can't show deleted lines; `git log` with a path or search string finds those.

With a good revision, a bad one and a repeatable check, `git bisect` finds the first bad commit. Don't bisect an unbuildable range or blame a revision for a missing env dependency.

Use the smallest history tool that answers the question.
EvidenceNext checkLimit
One suspicious current lineBlame, then the whole commit diffLast edit is not causation
A removed condition or renamed fileSearch Git history and compare diffsCurrent-line blame may miss it
Known good and bad revisionsRun the same check through bisectThe check must be deterministic
A recently merged PRRead its commits, review, checks and final diffA green check may not cover this behavior

Connect the commit to the PR and session

GitHub's PR views show what the change intended and what was reviewed. Canopy's Agent Workspace links a session to its checkout, commits, branch, diff and PR. Attribution varies by CLI, so treat the link as a strong pointer, not a full record.

Commit author, PR author and agent session are different identities. Manual edits, rebases and squash merges break one-to-one stories. If you can't find the session, keep the Git evidence and don't guess.

  • Match repository, checkout, branch, commit or PR, and time.
  • Compare the session's task and tool output with the actual diff.
  • Mark attribution confirmed, partial or unknown.

Give the fix to the right agent

Give the fixing agent the reproduction, suspect revision, diff and acceptance check, and ask it to explain the cause before editing. Resume the original session in the correct checkout if its context still helps; otherwise start a focused new one. Use a separate session or model for an independent review. Don't revert a broad PR just because the error followed it. The fault may be an environment change or an old assumption the new code exposed.

Close the incident with the final state

Repeat the failing action, run the regression check, read the final diff and confirm the PR checks. Write down which commit caused the bug, the evidence, who fixed it and what's still uncertain. A short incident trail beats a raw transcript. What counts is corrected code and observed behavior, not the agent's last message.

Copyable resources

Regression trace card

Label evidence so a suspected session isn't presented as a proven cause.

Failure and exact reproduction: [ ]
Environment, URL, branch, and deployed or local commit: [ ]
Last known good revision and check: [ ]
Suspect commit, PR and diff: [ ]
How it was found (blame, history, bisect, review): [ ]
Agent session and checkout (confirmed, partial or unknown): [ ]
Fix owner and acceptance check: [ ]
Final behavior, tests, diff and open questions: [ ]

Frequently asked questions

Does Git blame prove which agent caused a bug?

No. It shows the revision that last changed a current line. Check the full history, behavior and workspace evidence before attributing a regression to a session.

What if a PR was squash merged?

Use the PR's commits and final diff alongside the merge commit. The squashed commit alone may not map one-to-one to each agent session.

Should the original agent fix its own regression?

It can, if that session still has the right context. Give it the reproducible failure, then check its diagnosis and diff. Get a separate review for risky fixes.

More questions and answers →

Sources and further reading