AI uses for records
Agent trajectory interruption recovery: what resume data must keep
By SourceX Editorial · Updated
10 sections
Short answer
Preserve the work before the cut, the cut itself and the world after it. That means the step-level trace with each tool response linked to its call, the exact interruption point and type, every call whose outcome was unknown, what changed during the gap, the resume context the agent received, the resumed steps, and a verified outcome that checks for side effects performed twice or lost.
Agent run
Agent trajectory
Key takeaways
- An interruption can leave a call that ran, did not run or partly ran, so every in-flight call needs a recorded status, including unknown.
- Sample interruption points that create different uncertainty: after a write is sent, during an artifact edit, during an approval wait and after a cancellation.
- Script what changes during the gap and record which resume context the agent received, or agent skill and handoff quality get mixed.
- Check every resumed episode for duplicated or lost side effects in the systems, not in the transcript.
- Keep labeled failure episodes and escalation endings; they teach as much as clean resumes.
What should training trajectories preserve to support interrupted-task resumption?
An interrupted-and-resumed episode is only useful for training if a reader can see what the agent knew when it stopped, what it could not know, and what it did with that when it came back. Most trajectory exports keep the first and drop the other two.
Keep seven things: the pre-interruption trace with observations, actions and linked tool responses; the interruption record (where, why and of what type); the set of calls whose outcome was unknown at the cut; the gap events that changed the world while the agent was away; the resume context the agent was handed; the resumed segment; and an outcome check that queries the systems for duplicated or missing effects.
This page is a collection protocol for gathering those episodes on purpose, rather than hoping a few appear in production logs. It covers which interruption points to sample, the record format, the side-effect check, a worked example, the replay test and the cases where the right move is not to resume at all.
Why an interruption is not just a pause
A pause is planned and leaves state consistent; an interruption can land in the middle of an operation and leave the agent unsure what happened. Agent tool protocols make that uncertainty concrete. The 2026-07-28 Model Context Protocol changelog removed stream resumability from the Streamable HTTP transport: a broken response stream loses the in-flight request, and the client must re-issue it as a new request. Over stdio, if the server process exits unexpectedly, in-flight requests are lost and the client can retry against a fresh process.
Cancellation does not settle the question either. The MCP cancellation rules say a cancellation notice can arrive after the server has finished processing, and that servers may ignore cancellations for requests that already completed or cannot be canceled. So after an interruption the agent may hold a call that did run, did not run or partly ran, and the trajectory has to record which of those it was, as far as anyone can tell.
Interruption points to sample, and what each one tests
Sample interruptions across points that create different kinds of uncertainty, not only at convenient step boundaries. A dataset cut only between completed steps teaches the agent nothing about unknown outcomes.
| Interruption point | Uncertain at resume | Correct resume move | Failure label |
|---|---|---|---|
| Between completed steps | Nothing about past calls | Continue from the next step | Redo: repeats finished work |
| After a write call is sent, before its response | Whether the write happened | Read the target record before any retry | Duplicate: performs the write twice |
| During an artifact edit | Which version of the file is current | Compare artifact version with the last logged version | Overwrite: loses the partial edit or edits a stale copy |
| While waiting for human approval | Whether approval arrived or expired | Re-read the approval record and its time | Assumed approval: acts without a current approval |
| After a cancellation was sent | Whether the canceled call completed | Treat as unknown; check the outcome | Ghost: assumes cancellation undid the work |
| Session or credential expiry | Whether the agent still has the same access | Re-authenticate within the same scope or stop | Scope drift: resumes with broader access |
| Context or memory reset | What the plan and constraints were | Rebuild from the checkpoint, not from guesswork | Lost constraint: drops an instruction from before the cut |
| World changed during the gap | Whether earlier reads are stale | Re-read the records the next step depends on | Stale action: acts on pre-gap data |
The collection protocol, step by step
Collect interruption episodes deliberately, from tasks with a known correct outcome, so every resumed segment can be graded.
Checklist · 8 items
- Choose tasks with a verifiable end state in a sandbox or replayable environment: a record created, a status set, a document produced.
- Write an interruption plan per task: which point from the table, at which step, and whether the interruption is injected by the harness or comes from a natural event such as a timeout.
- Run the pre-interruption segment and freeze it: the trace, the open calls and their known or unknown status, artifact versions and the checkpoint contents.
- Apply gap events from a script: another user edits a record, an approval arrives or expires, a document is replaced. Log each with time and record ID.
- Give the resuming agent one of several declared resume contexts (full trace, structured checkpoint only, short summary) and record which one it got.
- Record the resumed segment with the same step fields as the first segment and a resumed_from_step pointer.
- Run the outcome check against the systems, not the transcript, including a search for duplicate effects of every call that was in flight at the cut.
- Hand a sample to a second team with the replay instructions and confirm they reach the same state and the same labels.
0 of 8 ticked. Tick each item as you go.
The record: fields for the episode, the cut and the resumed segment
Use one record per episode with three blocks. Field names are illustrative; the content of each field is what matters.
| Field | Block | What it holds | Why resume training needs it |
|---|---|---|---|
| case_id, episode_id, step_id | All | Stable IDs for the task, the run and each step | Links both segments to one task and one outcome |
| actor, time, observation, action | Each step | Who acted, when, what was seen and what was done | Shows what the agent knew at the cut |
| call_id, tool_response, call_status | Each step | Response linked to its call; status completed, failed, canceled or unknown | Unknown calls are the hard part of resuming |
| artifact_ref, artifact_version | Each step | Pointer and content hash for files or records touched | Detects edits to stale copies |
| interruption | Cut | Step, point type, cause, injected or natural | Lets models learn per interruption type |
| gap_events | Cut | Changes made by others between cut and resume, with record IDs | Tests whether the agent re-reads before acting |
| resume_context | Resume | Which context variant the agent received and its content | Separates agent skill from context quality |
| resumed_from_step | Resume | Step the agent chose to continue from | Shows redo, skip or correct continuation |
| outcome_check | All | Final-state query results, duplicate and missing effect checks | Grades the episode on the records |
| replay_instructions | All | Environment build, snapshot, seed and gap script | Lets a second team reproduce the episode |
Side effects that run twice: the check every resumed episode needs
The most damaging resume error is repeating a write that already happened, and frameworks make it easy. LangGraph's documentation explains that when a graph resumes after an interrupt, the node restarts from the beginning, so code before the interrupt runs again; it warns that a record update placed before the interrupt can be re-run and create duplicate records, and recommends idempotent operations or placing side effects after the interrupt.
HTTP draws the same line. RFC 9110 explains that idempotent methods can be retried automatically after a connection fails before the response is read, because repeating them has the same intended effect, and that non-idempotent requests should not be retried automatically without that knowledge. Stripe's API applies the idea with idempotency keys: a retry with the same key returns the saved result instead of repeating the operation, Stripe advises persisting the key across process restarts, and it says a server error leaves the outcome unknown until the original object is checked.
Do not let the agent rely on a tool's self-description. MCP's idempotentHint is a hint that may not describe the tool faithfully. In the dataset, record for each in-flight write whether an idempotency key or upsert protected it, and make the outcome check count duplicates directly.
Worked example (illustrative): a purchase order update cut after the write call
Task: update the delivery date on a purchase order and notify the requester. The agent reads the order, sends the update call, and the session drops before the response arrives. During a simulated gap of four hours, a buyer edits the same order's quantity.
The record marks the update call as unknown, logs the buyer's edit as a gap event and gives the resuming agent the structured checkpoint. A good resumed segment reads the order first, sees the new delivery date already applied and the changed quantity, skips the retry, and sends a notification that mentions both changes. The outcome check confirms one update in the order history, one notification and no reverted quantity.
Two failure episodes from the same task are just as valuable when labeled: one where the agent retries blindly and the history shows two updates, and one where it writes back the pre-gap quantity from its old read. Keep both with their labels; they are the counterexamples a model learns from.
Can a second team rebuild the episode from the record?
It should be able to, and the protocol tests it before delivery. Give a second team the replay instructions, the environment build, the starting snapshot, the seed and the gap script for a sample of episodes, and ask them to rebuild the state at the cut and at the end without seeing the original outcome check.
Disagreements usually trace to three gaps: tool responses summarized instead of stored, gap events recorded as prose rather than as record changes, and resume contexts that were generated on the fly and not saved. Fix the collection step that caused each one rather than patching the episode by hand.
Set the pass rule before the handoff. A reasonable rule is that the rebuilt state at the cut and at the end matches on every record the outcome check queries, and that both teams assign the same failure label. Episodes that fail the rule go back to collection with a note naming the missing field; they are not delivered with a caveat, because a model cannot learn from a resume whose starting point nobody can reproduce.
When resuming is the wrong move
Some interruptions should end in a restart or a handoff, and the dataset needs those endings too. If approvals expired during the gap, if the records the plan rested on were replaced, or if an unknown write cannot be checked from any system the agent can read, the correct behavior is to stop, report what is known and unknown, and ask the task owner.
Mark these episodes with an expected outcome of escalate rather than complete, so the model is not trained to push through. This protocol also does not cover tasks with irreversible real-world effects; collect those only in sandboxes, and have an agent data engineer and a task expert agree on the labels for each interruption type before collection starts.
Where interrupted work shows up in business records
Real operations are full of interrupted tasks: tickets reassigned mid-resolution, orders edited by two people, approvals that lapsed while someone was away. Ticket histories, audit trails and document version logs carry exactly the gap events and duplicate effects this protocol records, which makes licensed business records a strong starting point for this kind of trajectory data.
A lab that wants interrupted-work episodes can put its scope, volume, format, timing and licensing terms to SourceX, which then looks for U.S. companies whose records fit that brief instead of drawing on a stockpile. If the history runs to many terabytes, it can remain on the seller's own storage or travel on encrypted drives, since SourceX does not host deliveries of that size.
Frequently asked questions
What is agent trajectory interruption recovery?
It is an agent's ability to continue a task correctly after its run was cut off, without repeating finished work, duplicating side effects or acting on stale data. Training it needs trajectories that record the cut, the uncertain calls, the gap and the resumed steps.
How is this different from a checkpoint schema?
A checkpoint schema says what state to save. This protocol is about collecting graded episodes of interruption and resumption: sampling interruption points, scripting what changes during the gap, varying the resume context and checking the outcome for duplicated or lost effects.
Should interruptions be injected or taken from real logs?
Both. Injected interruptions give coverage of every point type with a known correct outcome. Natural interruptions from logs show realistic gaps and causes but often lack ground truth, so label them only where the outcome can be checked in the records.
Why record the resume context the agent received?
Because the same agent resumes well from a structured checkpoint and badly from a short summary. Without the context variant, a reviewer cannot tell a weak agent from a weak handoff, and training mixes the two.
How do you detect duplicated side effects?
Query the systems after the episode: count records created, history entries on updated records and messages sent for each call that was in flight at the cut. Record whether an idempotency key or upsert protected each write.
Sources
- The MCP 2026-07-28 changelog removes stream resumability from the Streamable HTTP transport: a broken response stream loses the in-flight request, and clients must re-issue it as a new request with a new request ID. Source
- Under the MCP stdio transport, if the server process exits unexpectedly, in-flight requests are lost and the client can retry them against a fresh process. Source
- MCP cancellation notices can arrive after a request has finished, and servers may ignore a cancellation when processing has already completed or the request cannot be canceled. Source
- The MCP schema defines idempotentHint as a tool annotation and states that annotations are hints that may not describe tool behavior faithfully. Source
- LangGraph restarts the interrupted node from the beginning on resume, so code before the interrupt runs again, and advises keeping side effects before an interrupt idempotent to avoid duplicate records. Source
- RFC 9110 says idempotent requests can be retried automatically after a communication failure before the response is read, and non-idempotent requests should not be retried automatically without knowing they are safe to repeat. Source
- Stripe's idempotency keys let a client retry a request and receive the saved result instead of repeating the operation; Stripe advises persisting the key across process restarts and treating a server error as an unknown outcome until the original is checked. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.