Agent amnesia: a continued session lost its own history
Postmortem of Clever Hare session 755f1717 (2026-11-13): a continuation run lacked owner authority, reading the browser tool's docs flagged the thread as private, and the agent's own context was redacted mid-task. Plus the long-term fix.

Agent amnesia: a continued session lost its own history

Session: Clever Hare, thread:755f1717-584c-4819-b2f2-1a53466c23aa ("Rebuild Market Street as weather app"), local dev app environment, 2026-11-13, model gpt-6-astra.

What the user saw: asked Clever Hare to rebuild the Market Street app as a weather app. After about 25 seconds of normal work, the agent forgot the task. It said it could not see the user's message ("it appears as private content"), asked the user to resend it three times, and tried the browser four times; every attempt was refused. The run ended with the plan open and nothing built. No data was lost and nothing wrong was published; the request was simply dropped, with misleading messages.

Timeline (seconds from the start of the session)

    0.0 The user's message arrives in "Create Get Weather tool". The agent judges it a new phase and continues the conversation in a new session, 755f1717. The continuation copies the message, writes a handoff and enqueues a run for the successor. That run is created with origin: "agent".

    10.6 to 17.3 The agent works normally: it reads the write guides for pages, apps and documents, its memory, the app, the app's directory, the tool code, and the contracts for execute and browser (read ~/tools/browser, event 20).

    17.3 The privacy scanner records the session as private at seq 20: the read result for the browser contract carries name: "browser", and the scanner treats any record named browser as browser data. No browser call has been made at this point.

    23.2 The agent delegates a small script to read the rest of the pages guide. The run parks and waits for the child.

    23.4 The child finishes; the parent resumes and rebuilds its model context from the stored log.

    26.4 The first request after resuming carries about 10k input tokens with no cache hit, roughly the system prompt alone. The whole history, including the user's request and the handoff, was replaced by "Private content is only available to the agent owner" stubs. The agent no longer knows what it was doing.

    26.4 to 41.7 The agent tries to recover: it lists its threads and reads its own thread, which comes back redacted. It reads the app again.

    48.6 It tries browser snapshot and is refused: "Browser access is only available in interactive runs started by the agent owner."

    56.6 It tells the user it cannot see the results and asks them to resume from the owner's session.

    56.6 to 83.1 The open-plan nudge fires three times ("This turn is ending with work you committed to still open"). Each time the agent rebuilds the same redacted context, tries the browser again, is refused again, and asks the user to resend the message.

    83.1 The run ends with "Unfinished plan steps: Build and publish animated weather app, Validate and test weather interactions."

Root causes

1. A continuation run loses the owner's authority

#interactiveOwner(run) grants owner access (full model history, the browser, private memory) only to a run with origin: "user", on the interactive queue, with no parent, carrying user message ids, in a top-level session. The continuation path (api-service.ts, the successor enqueue after a phase-change handoff) enqueues the successor's turn with origin: "agent", even though its comment calls it "a fresh interactive turn" answering the user's message. So every session born from a continuation runs without owner access, although the turn exists only because the owner typed something.

2. Reading the browser tool's documentation marks the thread private

containsPrivateData (browser-privacy.ts) treats any record whose name, tool or toolName is browser as private browser data. The read result for ~/tools/browser is {kind: "builtin", name: "browser", markdown: …}, the tool's public contract. The scanner matches it, and the session's privacy row turns private at that seq. Agents read that contract routinely, so ordinary threads can turn private this way without the browser ever being used.

3. Redaction meant for other readers is applied to the agent's own context

The privacy projection exists so that collaborators and public readers never see the owner's browser data. #piMessages and the per-turn state apply it whenever the current run lacks owner access: privateSession = !hasOwnerAccess() && scanSessionIsPrivate(sessionId). The intended rule ("this never changes the owner's model context") holds only if every turn the owner starts is recognised as the owner's. Cause 1 broke that. The agent was then given a transcript with its own user message, handoff, tool results and plan removed, with no sign that anything was hidden or why.

Before parking, the model's context lived in memory and was correct. The first rebuild from storage, after the delegate returned, was redacted. That is why the failure appeared mid-task rather than at the start.

4. Recovery loops instead of stopping

    The browser tool is still offered in runs that cannot use it, and its refusal says nothing about what to do instead.

    The open-plan nudge has no progress check. Three nudges replayed the same redacted context and produced the same failing browser call and the same request to resend.

    Nothing tells the user that this turn ran without owner access, or that its history was hidden.

Impact

    The user's request was dropped: no weather app was built.

    The user got three misleading replies, each asking them to resend a message they had already sent.

    The agent spent about 60 seconds and 13 model requests on a dead end.

    Any session born from a continuation behaves the same way once it touches anything the scanner calls private, including just reading the browser contract. Root cause 2 also makes ordinary threads private for non-owner readers (collaborators, public chat), who then see stubs where no browser data exists.

Short-term workaround

    Start a new thread with Clever Hare (New chat), not a reply in 755f1717 or "Create Get Weather tool", and paste the request again. The first turn of a new thread has origin: "user", so it has owner access. If the thread is later flagged private, the agent still sees its full history and can use the browser.

    Do not reply in 755f1717. It now contains real (refused) browser calls, so it stays private, and every turn there is a continuation run without owner access.

    If an agent replies that it "can't see your message" or that something "appears as private content", treat that as this bug. Start a new thread rather than resending.

    Two-line hotfix, if a patch is acceptable (not yet applied):

      In the continuation path, enqueue the successor's turn with origin: "user". The turn carries the user's copied message id, and #interactiveOwner already checks that the input is a session-message with user event ids.

      In containsPrivateData, ignore read results whose kind is builtin (tool contracts), and match browser only on tool_call and tool_result events of the browser tool itself.

Long-term solution

The design goal stays the same: browser data and private memory are visible only to the owner, and other readers get a projection. The fixes make authority follow the human, make the classifier precise, and make a missing capability fail loudly instead of causing silent amnesia.

A. Authority comes from who asked, not from which code path created the run

    Give every run an explicit principal: the account on whose behalf it runs, and whether that account is acting now (an interactive owner turn) or the run is automated (trigger, schedule, wake, public chat, collaborator).

    Derive it from the provenance of the user event that started the turn: the signed envelope's account, recorded on the event as meta.signerId. The run's origin should no longer decide it.

    Carry the principal through every edge: continuation successors, parked and resumed parents (resume after delegate or wait), workflow children, and sub-sessions.

    A continuation forwards the initiating event's principal. A resumed parent keeps its own. A child gets its parent's principal, narrowed by the child's tool grants.

    Replace #interactiveOwner(run) with runPrincipal(run), used by every gate (browser, private memory, privacy projection, thread: reads). One function, one table of cases, one test per case: user turn, continuation, resume after delegate, resume after wait, workflow child, sub-session, trigger, schedule, collaborator turn, public-chat turn.

    Add a regression test that reproduces this incident: a phase-change continuation, then reading ~/tools/browser, then a delegate, then the resumed turn. It asserts that the resumed turn still has the user's message, the handoff and its plan in context, and that the browser gate allows the owner.

B. Classify private data by what it is, not by matching names

    Browser data is exactly: tool_call and tool_result events of the browser tool, attachments from those results, and model text produced while such results are in context. Match on the event's type and its own name, never on any nested field called name.

    Private memory is exactly: reads and writes whose resolved memory path is under private/. Resolve the path with the same normaliser the memory layer uses, rather than a separate regex.

    Contract reads (read ~/tools/<name>, kind: "builtin"), guides, and help text are public by construction and never count.

    Store why a transcript is private, not just that it is: the first seq, the event type and the matched rule. Show it in the inspector ("private since seq 36: browser snapshot"). Add a cheap backfill that rescans existing rows under the new rule, so threads flagged by name collisions are cleared.

C. Never feed a model a redacted version of its own thread

    The projection is for readers. A run that may not see a thread's private data must not be given a quietly redacted copy of that thread as its memory.

    When a run's principal lacks access to private data in its own session, do not start the turn. End it with a clear status, such as "This thread holds the owner's private browser data. Only the owner can continue it." Show that to the user, and offer to continue in a new thread with a public handoff.

    If a projected context must ever be used (a public-chat or collaborator turn in a private thread), say so explicitly in the context ("N events are hidden from you because they contain the owner's browser data; do not ask the user to resend them") and keep the user's own new message unredacted. The person who just typed it is the one reading the answer.

    Keep handoffs projection-safe. A continuation handoff that quotes browser data should say so and be stored with its own privacy verdict, so the successor's purpose and request survive even when quotes are hidden.

D. Fail fast instead of looping

    Offer the browser tool only in runs whose principal can use it, as with execute when sandboxes are off. A refusal should say what to do instead ("continue without the browser; tell the user what you could not verify").

    Give the open-plan nudge a progress check: no new successful tool results and the same failing call since the last nudge means no further nudge. Close the plan steps as blocked, with the reason, and report once.

    Cap identical failing tool calls per turn (for example, the same tool and input failing twice ends the attempt).

E. Observability

    Record, on each run, the principal, whether it had owner access, and the privacy verdict of its session when context was built. Show this in the run inspector and the session header ("ran without owner access").

    Add a metric and an alert for model context built with redacted history: it should be near zero outside public chat.

    Log when a continuation is created and with which principal.

Rollout

    Hotfix (the two lines above), with the incident regression test.

    Introduce runPrincipal with its table of cases and move the gates to it; keep the old function as a cross-check for a release.

    Change the classifier rules, rescan the privacy table, and add a "why private" field.

    Refuse turns that would need a redacted copy of their own thread; add tool-availability gating and the nudge progress check.

    Add the inspector fields and the metric.

Acceptance

    The incident sequence (continuation, contract read, delegate, resume) keeps full context and owner tools.

    Reading ~/tools/browser never changes a thread's privacy.

    A non-owner turn in a genuinely private thread ends with one clear message, makes no model request with redacted history, and does not loop.

    Every run shows its principal and whether it had owner access.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

People