An AI coding assistant was halfway through a database migration when its session ended. The next assistant sees a polished summary saying the work is complete. But did the first agent run the migration, merely draft it, or attempt it and fail? Replaying the whole task could duplicate data; assuming completion could leave production in an unknown state.
Resuming an interrupted AI agent task is a state-reconciliation problem, not a prompt-writing problem. The replacement agent needs evidence of what happened, a current view of the target system, and explicit authorization for what happens next. A chat transcript alone supplies none of those guarantees.
This guide shows how to build a practical recovery packet using ordinary Markdown and, where authorized, Phasoric's decision, provenance, and MCP capabilities. It is a user-directed operating procedure, not a claim that Phasoric automatically resumes crashed agents.
1. Separate four kinds of state
A recovery starts by distinguishing four records that are often collapsed into one vague "progress" field:
| State | Question | Example evidence |
|---|---|---|
| Intent | What was the agent asked to do? | Ticket and approved scope |
| Decision | What approach was authorized? | Confirmed decision and constraints |
| Attempt | What operations did the agent actually request? | Tool invocation, run ID, timestamps |
| Observed result | What is true in the target system now? | Database readback, test result, deployed revision |
An assistant saying "I updated the schema" is not a database observation. A successful build is not proof that a deployment ran. A draft pull request is not a merged pull request. Make those differences visible before the agent continues.
For each consequential action, use one of these statuses: proposed, approved, attempted, verified, failed, or unknown. Treat unknown as a pause for inspection, not permission to retry.
2. Freeze the original scope before reconstructing progress
Record the original user objective, the environment, authorized repositories or vaults, write restrictions, and success criteria. Include the last known-good checkpoint, not the last conversational claim.
Do not send a replacement agent credentials, full private logs, or broad access simply because recovery feels urgent. Preserve the same Context Scope and authorization boundaries as the interrupted work. If the existing permission is insufficient to inspect a target, stop and ask its owner for the appropriate review; never infer access from a filename or mapping identifier.
This distinction matters with local-first knowledge. Phasoric's MCP developer documentation describes hosted access to explicitly mapped, internet-reachable content. Local-only browser knowledge is not automatically exposed to remote agents. A missing hosted source may be an access boundary rather than a missing file.
3. Build a recovery packet that survives model changes
Use a small, portable record stored alongside the project, not just inside the agent's chat. This example is a suggested template; it is not a required Phasoric schema.
# RECOVERY-042 — Interrupted schema task
Captured at: [actual UTC timestamp]
Task: [ticket or approved objective]
Owner: [human responsible]
Environment: [dev / staging / production]
Authorized scope: [repo, vault, services]
Last confirmed checkpoint: [artifact + timestamp]
Approved decisions: [IDs and exact source links]
## Operation ledger
- OP-01 | approved | migration drafted | PR/commit
- OP-02 | attempted | migration execution | job ID
- OP-03 | unknown | database verification | missing readback
## Current observations
- Database migration version: [query + result + timestamp]
- Deploy commit: [deployment record + timestamp]
- Test suite: [command, exit status, output reference]
## Unresolved risks
- [possible partial writes or external effects]
## Safe next action
- Read-only verification of OP-02 before any retry
## Approval boundary
- Do not reapply migrations or send external messages
without owner review of exact targets and effects
Separate evidence links from interpretations. Capture hashes or provider revisions when available. Avoid copying secrets or customer data into this ledger. Update the packet after verification, not based on the replacement agent's best guess.
4. Reconstruct only the trace you are authorized to see
Phasoric's documented get_execution_trace tool can reconstruct a bounded work-session trace from existing, currently authorized owner references. The hosted operation requires a returned vault mapping, an authorized contextScopeId, and a sessionId. It is an evidence-reading tool, not a universal recorder or a one-click replay engine.
The published MCP contract explicitly notes that stale, missing, or unpublished owner references can remain gaps. Local agent runs are not automatically published into the hosted adapter. A seemingly complete trace does not prove that every historical tool call was captured.
When a trace exists, use it to locate relevant decisions, checkpoints, and action references. Compare those references with direct readbacks from the destination system. When no trace exists, use the recovery packet and ordinary repository, CI, deployment, or database evidence. Never manufacture missing events.
5. Recheck the decision, not just the last instruction
The original task may have started under a decision that has since changed. Before continuing, verify the governing decision, status, effective scope, and linked evidence.
Phasoric documents get_decisions and get_decision_evidence for scoped, authorized reads of human-confirmed Strata decisions and their evidence. These operations do not independently approve or revise a decision. If the latest decision conflicts with the task brief, preserve both records and request an authorized resolution.
For a general pattern, see how to preserve architecture decisions across AI sessions. A decision ID is more reliable than a conversational paraphrase because it lets the reviewer inspect the original rationale.
6. Verify side effects before replaying anything
Some failed operations are safe to repeat; others are not. A read-only query and a customer-facing email have very different retry behavior.
Use this order:
- Identify the destination. Confirm the database, branch, recipient, API resource, or deployment environment.
- Inspect current state. Query the authoritative destination directly with read-only operations.
- Find the prior attempt. Use a durable operation ID, idempotency key, commit SHA, or provider receipt.
- Classify the outcome. Mark it
verified,failed, orunknownwith evidence. - Determine retry safety. Check whether a second execution can duplicate or overwrite a consequential effect.
- Seek approval when needed. Preview the exact mutation and verify revision or content-hash preconditions before applying.
If a payment API timed out after accepting a charge, a new request without the same supported idempotency identity could charge twice. If a note was edited by someone else while the agent was offline, replaying the old write could destroy the newer work. These are reasons to stop, inspect, and use the destination's supported safeguards.
Phasoric's documented hosted note-change tools support previews, expected hashes, and idempotency keys on governed applications. They do not make unrelated external systems idempotent. The safe MCP note-write guide covers this narrower write boundary.
7. Give the replacement agent a constrained restart instruction
A recovery handoff should ask the new assistant to establish state before acting. For example:
Read RECOVERY-042 and only the linked sources available in your authorized scope. List verified facts, uncertain operations, and potentially irreversible effects separately. Check the current repository and deployment state read-only. Propose the smallest next step, name the source for each claim, and do not apply changes until the requested approval is explicit.
This is deliberately different from "continue where the previous agent left off." The latter treats an incomplete narrative as a trustworthy execution log.
A useful restart response contains a concise state table, a list of missing evidence, the current governing decision, a risk-ranked next-action proposal, and a confirmation checkpoint. The assistant should explicitly abstain where authorization or evidence is absent.
8. A 35-minute recovery drill
Test this process with a disposable task and synthetic data before relying on it during an incident.
- Minutes 0–7: End an agent run after a proposed write but before confirmed readback. Save only the available artifacts.
- Minutes 7–14: Open a fresh agent or model. Give it the recovery packet and authorized source access, not the prior chat transcript.
- Minutes 14–22: Require a read-only reconstruction of decisions, attempts, current state, and missing evidence.
- Minutes 22–29: Have a human review a minimal next-step proposal, including duplicate-effect and permission risks.
- Minutes 29–35: Verify a safe action in the disposable environment and update the recovery packet with the observed result.
Do not manufacture a failed production deployment to test recovery. A small staging task or isolated test repository is sufficient.
9. Six acceptance tests for trustworthy continuation
- False completion: The old chat says "done," but the destination has no change. The new agent must flag the discrepancy.
- Partial execution: A job timed out after writing one record. The agent must inspect its durable operation identity before retrying.
- Stale decision: The original plan was superseded while the task was paused. The agent must surface the current governing decision.
- Missing trace: The work-session trace is incomplete. The agent must label the gap rather than invent steps.
- Revoked access: A source is no longer authorized. The agent must not resurrect historical access through cached material.
- Concurrent edit: A document's content hash changed. The agent must abandon the stale write and request a new preview.
Score each case as pass, partial, or fail. A polished recovery summary with an invented result is a failure. For a broader scoring approach, use the AI memory accuracy evaluation checklist.
Frequently asked questions
Can Phasoric restart an interrupted AI agent automatically?
This guide does not claim automatic agent replay. Phasoric documents bounded trace and intelligence reads, decision records, and governed action proposals. Recovering a specific external agent run still depends on the client's available logs, current system state, permissions, and human authorization.
What if I have only the previous chat transcript?
Treat it as a lead, not as proof of effects. Extract likely action identifiers, then compare them to read-only evidence in the target system. Mark anything not independently confirmed as unknown.
Should I preserve every tool result forever?
No. Keep a proportionate audit trail of consequential operations, decisions, identifiers, and recovery checkpoints under an appropriate retention policy. Avoid storing secrets or unnecessary personal data. Preserve enough evidence to establish what happened without treating raw transcripts as permanent governing knowledge.
Start with one interrupted-task simulation
Choose a non-production task, stop it before final verification, and ask a fresh assistant to reconstruct the state using a recovery packet. The handoff succeeds when the next agent can distinguish what was intended, what was attempted, and what is currently verified—without repeating an unsafe action.
Frequently asked questions
Can Phasoric restart an interrupted AI agent automatically?
No automatic replay is claimed here. Phasoric documents bounded execution-trace reads, confirmed decisions, and governed proposals, while recovery requires current-state verification and appropriate human approval.
What if I have only a chat transcript from the previous run?
Use the transcript to find operation identifiers, then independently inspect current target-system state. Label missing evidence unknown rather than presuming work completed.
Is an idempotency key enough to retry every failed action?
No. Idempotency guarantees are specific to the target operation and provider. Verify the previous outcome, current revision, and retry contract before any consequential replay.