• Docs
  • Talk to an expert
Blog
Blog
BlogProductCase studiesNewsInsights
Blog

Reconstruct any agent run later: what gets captured, and why

AI AgentsUpsun DispatchAI EngineeringGit
18 November 2026
Jack Creighton
Jack Creighton
Senior Product Marketing Manager
Share
This post is also available in German and in French.

TL;DR

  • Git history tells you what an agent changed. It can't tell you what the agent was asked, who asked it, what it read, or what it planned.
  • Upsun Dispatch™ captures every prompt, diff, approval, and usage event as it happens, logged against the run that produced them.
  • For Issue to code runs, the trail starts on the issue itself: a structured plan with assumptions and risks, then a link-back to the PR.
  • In the Upsun Dispatch console, each run shows its steps, timeline, prompts, tool calls, findings, logs, and usage, so you can trace a change back to its intent.
  • The record makes debugging and review easier. Deciding whether the change was right is still your call.


An alert fires on a Tuesday morning. Exports for a handful of customers are timing out, and only for accounts created before 2023. You trace it to a query change that shipped months ago.

git blame points at a merge commit from a branch called company/issue-418. The PR was opened by an agent and approved by someone who has since moved teams. The commit message says "Optimize export query for large accounts."

That's a start. What you need to know is why the agent chose to drop the index hint, whether it knew about the legacy account schema, and whether anyone flagged the risk at the time. Those answers lived in the agent's run, and whether you can still get to them depends on whether anything recorded it.

Why git history isn't enough for agent work

Key takeaway: git records the result of a change. For agent work, the context that explains the result lives in the run, and it disappears unless something keeps it.

For human-written code, git history plus a bit of asking around usually gets you to the reason behind a change. The commit message gives you a hint, the PR discussion fills in some gaps, and the author can usually remember the rest.

Agent work breaks that chain in three places.

  1. The instructions aren't in the repo. An agent acts on a prompt and a bundle of context: the issue, its comments, linked tickets, the files it chose to read. None of that ends up in the commit. If the agent misread the issue, the diff won't show it.
  2. The plan isn't always in the repo either. Before writing code, an agent decides on an approach and makes assumptions. Those assumptions are often exactly what you need when debugging, such as "assumes all accounts use the current schema." They rarely survive into the commit message.
  3. Local agent sessions don't leave a shared trail. When an engineer runs an agent on their laptop, the conversation and tool calls stay on that machine. Unless the engineer copies them somewhere, the team has the diff and whatever the engineer remembers to write down.

You can patch some of this with discipline, like pasting plans into PR descriptions or adding them to a docs directory. That works until the queue gets long. A record that's captured automatically, as the run happens, holds up better than one that depends on someone remembering.

What Upsun Dispatch captures for each run

Key takeaway: every prompt, diff, approval, and usage event is logged against the run that produced it, and each piece answers a specific question you'll have later.

Upsun Dispatch is the platform for governed collaboration between AI agents and cross-functional human teams. Every workflow execution becomes a run in the Upsun Dispatch console, and the record is captured as the run happens rather than assembled afterward. Here's what it holds and where to find each part.

What's recordedWhere you find itThe question it answers
Prompts and tool callsRun detail, in the activity feedWhat was the agent told, and what did it look at?
The plan: summary, full plan, files affected, complexity, assumptions, and risksPosted on the originating issue or ticketWhat did the agent intend, and what did it assume?
Plan approvals and revisions (Jira runs with the plan approval gate on)Run detailWho signed off on the approach, and what changed before coding?
Diffs, artifacts, opened PRs, and push outcomesRun detail, and the PR itselfWhat exactly changed, and where did it land?
Critic findingsThe PR description, and run detailWhat problems were flagged before anyone reviewed it?
Steps, attempts, and timeline eventsRun detailWhat happened in what order, and where did it retry or fail?
LogsShort excerpts in run detail, full logs per jobWhat did each step output?
UsageRun detail, plus usage reports by model or workflowWhat did the run consume?
The related PR's current state: title, lifecycle, review decision, head commitThe related entity viewWhat happened to the change after the run?

The record is append-only: entries can't be edited or deleted through normal use. Re-running a finished run starts new work and leaves the original run as it was.

Reconstructing a run, step by step

Key takeaway: start from the code, follow the links back to the issue, then open the run. Each hop answers a different part of "why."

Back to the timed-out exports. Here's how you'd work from the merged commit to the agent's reasoning.

  1. Start from the branch or the PR. Issue to code pushes to a branch named after the source issue, such as company/issue-418, so the issue number is in the branch name. The PR description can also carry the critic's non-blocking findings, so check whether anything about the query was flagged before review.
  2. Go to the issue and read the plan. Upsun Dispatch posts its plan back to the originating issue or ticket before writing any code, along with a link to the PR once one opens. The plan's assumptions and risks are the first place to look. If it says something like "assumes all accounts use the current schema," you've likely found where the bug started.
  3. Open the run in the console. Search or filter the runs list to find it. Run detail shows the run summary, its steps, and a timeline of events.
  4. Read what the agent saw and did. The activity feed shows the prompts and tool calls. This is where you learn whether the agent ever looked at the legacy schema, or worked only from the issue text.
  5. Check who approved what. For Jira-triggered runs with the plan approval gate on, run detail shows who approved the plan and any revisions made before coding. On the PR itself, the review history shows who approved the merge.
  6. Go to the logs if you need the detail. Run detail shows short excerpts. Open the logs for a specific job or step attempt to see the full output.

By the end, you know what the agent was asked, what it assumed, what it looked at, what was flagged, and who signed off. That's usually enough to tell a bad assumption from a bad review, and to fix the right thing.

What the record does and doesn't give you

Key takeaway: the record shows what an agent was given, what it planned, what it did, and who approved it. It can't tell you whether the change was right, and it only covers work that ran through Upsun Dispatch.

The record earns its keep in a few recurring situations: debugging a change long after it merged, writing a postmortem, reviewing a PR with context instead of a bare diff, and explaining to a teammate why the code looks the way it does.

It also has edges worth knowing before you rely on it.

  • It records what the agent wrote down and did. You see the prompts, the plan, the tool calls, and the outputs. Anything the model weighed without writing down isn't there, so the plan's stated assumptions are your best window into its reasoning.
  • It covers runs in Upsun Dispatch. Agent work done in a local session or another tool doesn't appear in this record.
  • Plan approval is narrower than it sounds. The plan approval gate applies only to Jira-triggered Issue to code runs, and it's off by default. For other runs, approval happens in your normal PR review.
  • Treat it as an engineering record. Entries are append-only, which makes the log hard to alter through normal use. It's useful evidence for your team, and on its own it isn't proof of compliance.

See a run record for yourself

The fastest way to understand what a run captures is to look at one from your own repository. Connect GitHub or GitLab, store a model key, and trigger a code review on a pull request. Every new organization starts on a free tier with no credit card required.

CTA: Run your first workflow


Frequently asked questions (FAQ)

What is an AI agent audit trail? 
A record of what an agent was asked, what context it used, what it planned and did, and who approved its work. It lets a team trace an agent-written change back to its intent after the fact.

What does Upsun Dispatch record for each run? 
Every prompt, diff, approval, and usage event, captured as it happens. Run detail in the console also shows steps, timeline events, tool calls, findings, artifacts, logs, and the related PR.

Where can I see an agent's plan? 
For Issue to code runs, Upsun Dispatch posts a structured plan to the originating issue or ticket before writing code. It includes a summary, the full plan, files affected, complexity, assumptions, and risks.

Can the record be edited after the fact? 
The log is append-only, so entries can't be edited or deleted through normal use. Re-running a finished run creates a new run and leaves the original unchanged.

Does the record show agent work done outside Upsun Dispatch? 
No. It covers runs that go through Upsun Dispatch workflows. Agent sessions on a developer's machine or in other tools aren't included.

 

Stay updated

Subscribe to our monthly newsletter for the latest updates and news.

Deploy possibility.
Try Upsun for free.

Build with DispatchDeploy on Cloud