When a Shopping Agent Stops, What Should Survive?
Session, state, memory, and artifacts determine whether an agent can continue—and whether it should.
Week 8 of the series. Last week, we examined what information reaches a shopping agent when it makes a decision. This week, the agent stops halfway through its work. When it returns, what should it remember? What can it reuse? And how does it know whether an order already went through?
You have finally found a dining table.
It seats six, fits through the apartment doorway, and comes to $887 with delivery. A Saturday appointment is available. After several evenings of comparing options, you tell your shopping agent: “Yes. Order this one.”
The agent starts the purchase. Then the service running it crashes.
When you return, the conversation is still there. So is the photograph of the table. But there is no order confirmation.
Should the agent buy it again?
Across town, the retailer has a similar problem. Its shopping agent for sellers has investigated falling sales, prepared a delivery-fee analysis, and asked permission to publish a weekend promotion. The process stops before the merchant answers.
When it restarts, should it publish? Ask again? Repeat the analysis?
As agentic commerce moves from helping people choose toward carrying out transactions and store operations, these interruptions become part of the product experience. A buyer needs continuity. A merchant needs control. Both need an accurate account of what has already happened.
“Does the agent remember?” is too broad a question to settle any of this.
1. When the chat survives, has the work survived too?
Session identity and execution history
Open a familiar shopping conversation and it is natural to expect the assistant to pick up where it left off. The messages are visible. The table is still on the shortlist. Your approval appears in the thread.
That thread is a session: an identity and history boundary for an ongoing interaction.
But a session is different from the process executing the work. A conversation can outlive a crashed worker. It can also preserve every visible message while leaving critical execution facts unrecorded.
“I’m placing your order” establishes what the agent said. It does not establish whether the store received the request, charged the selected payment method, or created an order.
On the seller’s side, “I’ll prepare the promotion” leaves similar questions. Was the analysis completed? Was the draft saved? Was publication requested, approved, or performed?
A reliable system needs an execution history alongside the conversational record: durable facts about requests, results, approvals, and actions.
The question to ask after an interruption is precise: what can the application establish after losing everything the worker held in memory?
2. How does the agent know what to do next?
State reconstruction and event sourcing
Suppose the buyer’s agent has saved three facts: delivery was checked, a purchase was proposed, and approval is pending.
The next step is to wait. Restarting the worker should not turn an unanswered approval request into permission to buy.
This is state: the current account of what is complete, pending, blocked, or ready to proceed.
One way to reconstruct it is event sourcing. The application records committed events, then uses them to derive the current state. A function called a reducer applies those events in order.
For the seller’s agent, the events might establish that the delivery analysis is complete, the promotion draft exists, and publication awaits a decision. Reconstructing that state allows the agent to continue without repeating the analysis or quietly publishing the draft.
This is recovery at a logical boundary. The application need not restore the exact processor instruction running when the crash occurred. It needs to recover the meaning of the work so far.
Temporal offers an example of this approach: its workflow replay uses recorded activity results to reconstruct progress rather than repeating completed activities. Temporal’s event-history walkthrough
The underlying requirement is durable evidence. “The assistant probably got this far” is insufficient when the next step can spend money or change a store.
3. Is everything in the history also memory?
Selective memory, scope, and provenance
During the table search, you rejected glass because it would show fingerprints. You also said that Saturday delivery works for this particular move.
Should both become permanent shopping preferences?
Perhaps you dislike glass furniture in general. Perhaps you simply disliked the glass table on that shortlist. And next month, weekday delivery might be perfectly convenient.
Memory is selected knowledge intentionally carried into later work. Saving a conversation does not automatically make every statement suitable for that role.
The seller’s agent faces the same judgment. A temporary stock shortage belongs in the investigation history. A confirmed operating policy about minimum margins may deserve broader reuse. A mistaken theory about delivery fees should not become a standing business assumption.
Useful memory needs scope: which person, store, task, or period it applies to. It needs provenance: where the information came from and whether it was confirmed. It also needs rules for correction and deletion.
For the buyer, that could mean distinguishing “no glass for this purchase” from “avoid glass in future furniture searches.” For the merchant, it means distinguishing a campaign-specific decision from a store-wide policy.
History records what happened. Promoting part of it into future guidance requires another decision.
4. If the agent saved a report, where is the report?
Artifact durability and versioning
The seller returns after the interruption and asks to see the delivery analysis.
The event history says the report was saved. But the file lived on a temporary worker that has since been replaced.
The application remembers the write. The report is gone.
An artifact is an output with a storage lifecycle of its own: a comparison sheet, a sales report, a promotion draft, or a downloaded receipt. Preserving a message about an artifact does not preserve the artifact itself.
A usable reference needs to lead to the expected content. Versioning or a content digest can help identify which report supported a recommendation, especially after someone edits it.
The buyer has a similar need. A comparison sheet should preserve the prices and delivery assumptions used at the time. A saved quotation is historical evidence; it does not establish that the price or Saturday appointment remains available today.
For the retailer, the report needs storage that outlives the worker that created it. Restarting on another machine should still lead to the same saved analysis, with its version identifiable.
The distinction matters whenever a product promises that work is “saved.” Saved where, for how long, and with which version available?
5. Which version of the information did the model receive?
Context provenance and historical inputs
By now, several records may describe the same table: the original listing, an earlier delivery quote, a current stock response, and the buyer’s saved comparison sheet.
The agent’s recommendation depended on a particular selection from these sources.
That selection is context, the input assembled for one model call. It connects this week’s recovery problem to last week’s context-assembly problem.
When investigating a bad purchase, a team needs to know whether the agent received the updated delivery charge or an older quotation. When investigating the seller’s promotion, it needs to know whether a sales explanation was still labeled as a hypothesis.
Context provenance records the sources and versions that informed the call, including relevant transformations such as summarization.
Suppose the retailer corrects its delivery charges after the recommendation. Opening the product page now will show today’s price, not necessarily the information the agent used yesterday. An investigation needs a protected record of the input supplied at the time, or an explicit account of what was retained and what is missing.
The same applies when the application changes how it selects information. Rebuilding yesterday’s request using today’s selection rules may produce a different request. The historical record should make that distinction visible.
6. What if the order succeeded just before the crash?
Unknown outcomes, idempotency, and reconciliation
Return to the $887 table.
The application records that the purchase action started. The store creates the order. Before the application saves the result, its worker crashes.
After restart, the local history contains a started action and no completion.
That absence cannot establish that the purchase failed.
This is an unknown outcome. The agent needs reconciliation: checking an authoritative source to determine what actually happened before deciding whether another attempt is safe.
A store may provide an order lookup or an idempotency contract that recognizes repeated requests for the same intended purchase. The details matter. Stripe’s API v1, for example, checks that repeated parameters match and allows keys to be removed after at least 24 hours. Reusing a key after removal can create a new request. Stripe’s idempotency documentation
A local “completed calls” list cannot, by itself, guarantee that a remote action happens exactly once.
The seller has the same exposure if a promotion publishes but its acknowledgment is lost. Repeating the action could create duplicate notifications or another campaign.
Some operations can safely converge on the same result under defined conditions. If the seller’s agent has exclusive control of an unchanged draft, replacing it with the same approved contents can leave the intended result intact. Publishing a promotion or submitting an order requires a different recovery policy: establish the outcome or use a valid service guarantee before retrying.
Sometimes the correct recovery message is: “I need to confirm what happened before proceeding.”
7. Does yesterday’s approval still authorize today’s action?
Approval binding and policy revalidation
Before the crash, the buyer approved a specific table at a specific total with Saturday delivery.
After restart, the price has risen and Saturday is unavailable.
The words “Order this one” remain in the conversation. They do not settle whether the changed purchase is authorized.
Approval binding connects a decision to the exact proposed action. A robust design also considers scope, expiry, and the policy under which approval was granted.
For the seller, permission to publish one reviewed promotion should not authorize a revised discount, a larger audience, or a different launch date.
Policy revalidation checks whether the recovered action is still permitted under current conditions. Historical approval and current validity answer different questions, so an agent may need to preserve the former while checking the latter.
A useful approval record would identify who authorized the purchase, which table and total they approved, and the delivery conditions attached. On returning, the agent can compare that record with the proposed action and seek a new decision when material terms have changed.
The useful product promise is that an interruption preserves the meaning and boundaries of permission—not merely the word “yes.”
8. Are replay, resume, and starting over the same thing?
Historical replay, continuation, and branching
A merchant investigating an unexpected promotion may want to inspect yesterday’s state without publishing anything again. A buyer returning to an interrupted search may want the agent to continue. Someone exploring an alternative may want a new branch.
These operations need different contracts.
| Operation | Shopping example | What the operation should establish |
|---|---|---|
| Replay | Inspect what was known before purchase approval | Reconstruct the past from recorded evidence without repeating external actions |
| Resume | Continue the interrupted table search | Reconstruct current state, then perform permitted pending work |
| Re-run | Search again using today’s availability | Start a fresh execution with new observations |
| Fork | Explore a smaller table from an earlier shortlist | Create a new history with explicit parent lineage |
Framework terminology varies. A replay may re-execute orchestration code while substituting recorded results. For the merchant inspecting yesterday’s promotion, the essential question is whether that inspection can trigger another publication.
A fork raises another practical question: what comes with the branch? Exploring a smaller table might carry over the budget and doorway measurement. It should not treat approval to buy the original table as approval to buy the alternative. Saved comparison sheets also need an explicit arrangement: copy them, retain working references, or make their absence clear.
Search can help locate a fact in the same history. Finding “approved” in an old message is only the beginning: the application still needs to establish which action that approval covered.
9. How much should the agent retain?
Data minimization and recovery testing
A shopping workflow can contain delivery addresses, payment-related references, private messages, and commercially sensitive reports.
Recording everything in an ordinary log would create a second problem while trying to solve recovery.
Data minimization asks what needs to be collected and retained. Necessary sensitive payloads need deliberate protection, access rules, and retention policies. OWASP identifies access tokens and sensitive personal information among data that should generally be excluded from ordinary logs. OWASP’s logging guidance
There is a trade-off to acknowledge. If the original request contained sensitive content and the retained copy removes it, that copy cannot exactly reconstruct the original input. Redaction is useful, but its limits should be explicit.
Recovery promises need testing, too.
A useful recovery test would interrupt the buyer’s agent just after the store accepts an order but before the confirmation is saved. Another would stop the seller’s agent while publication awaits approval. Restarting should expose the uncertainty in the first case and preserve the unanswered decision in the second.
For a shopping product, the tests that matter should follow the consequences. Does an unanswered approval remain unanswered? Does a completed observation get reused? Does an uncertain order trigger reconciliation? Can the saved report still be opened?
The buyer wants one table, at the agreed price, on an acceptable day. The merchant wants completed analysis preserved and an unpublished promotion left unpublished.
After an interruption, a capable agent should be able to explain what is known, what remains uncertain, and what it is permitted to do next.
Before trusting “I’ve picked up where we left off,” ask:
What survived—and what evidence makes the next action safe?
This is Week 8 of a 26-week series on agent systems from first principles: capability maps, skills vs. tools, memory and context, loops, harnesses, and the patterns that separate a demo from production.
Happy learning, happy building.
Tao
Also in the newsletter.