Agent.session doesn't carry memory across run() calls — expected?

We’re building an iframe app and driving it through `anna-app dev` in real mode (proxying to `staging.anna.partners`), on CLI `0.1.19` / `app-runtime 0.2.0` (SDK self-reports `v0.2.0`), creating sessions with `submode: “auto”`.

The problem: two consecutive `sess.run()` calls on the *same* `AgentSession` (same `app_session_uuid`) don’t seem to share any conversation context. In run A we tell the agent “remember this codeword: ZEBRA-51029, reply only OK” and it replies “OK”. In run B, on the same session, we ask “what codeword did I just ask you to remember?” — and instead of recalling it, the agent calls the `user_storage_get` tool, gets `{ok:true, found:false}`, and answers that it has no record. We get the same result even when run B is explicitly told to answer only from our conversation and not call any tools. (Run B’s prompt tokens roughly double, but that’s just the tool round-trip `total_calls: 2`, not run A being included — so token counts are inconclusive; the behavior is the real signal.) We expected run B to answer ZEBRA-51029 directly from session history without us persisting it ourselves.

A few possibly-related observations: `sess.history()` over the harness HTTP path throws “not exposed over HTTP; available only via in-process store”, which makes us wonder whether session memory itself is also in-process-only on this path (i.e. not threaded server-side across runs). Also, `submode: “auto”` injects tools like `user_storage_get` even though our manifest declares `tools: []`, and we couldn’t find a way to request a tools-free session (`fixed` mode needs a `fixed_client_id`, and ours is empty). Finally, the actual frame schema differs from the docs — it’s OpenAI-style chunks (text in `choices[0].delta.content`, plus `task_info` / `tool_*` / `task_complete` deltas and `stream_end` → `[DONE]` → `end` terminators), not the `event: “token”/“complete”` shape described.

So our questions: Is `agent.session` supposed to thread conversation across `run()` calls on the same `app_session_uuid`? If so, why doesn’t run B see run A? Is the no-recall a harness HTTP-relay limitation that would behave differently on a deployed app, or is it the platform’s actual behavior? Under `submode: “auto”`, is the intended memory model the `user_storage` KV tool rather than a transcript — and if so, what’s the recommended pattern for long transcript memory? And is there a supported tools-free session mode? This matters because if sessions don’t carry transcript memory across runs, `agent.session` gives us no advantage over `anna.llm.complete` plus our own `anna.storage`. Happy to be told we’re holding it wrong — pointers welcome. Thanks!

Hey! Thanks for the incredibly detailed write-up — this is one of the clearest bug reports we’ve gotten, and you nailed the symptom. Good news first: you’re not holding it wrong, and this is already fixed. :tada:

TL;DR

[agent.session] is supposed to thread the conversation across run() calls on the same [app_session_uuid] — that’s its whole point over [anna.llm.complete] + your own storage. Run B genuinely should recall ZEBRA-51029 straight from session history. The reason it didn’t is a real server-side bug that we patched 3 days ago.

What was actually broken

Each agent session maps to a stable LangGraph “thread” ([thread_id = aps:]), and every run() is meant to read/write that same transcript. On staging (which runs in worker mode), the code that hands the run off to the background worker was dropping the [thread_id] for app-origin runs. With no thread id, the worker skipped attaching the checkpointer entirely — so nothing was ever persisted, and run B started from a blank slate. That’s exactly why the agent fell back to user_storage_get and told you it had no record.

This is fixed in commit f38232f (v1.1.0-beta.39, landed 2026-06-05). After the fix, the run hand-off carries the thread id through, the worker attaches the checkpointer, and the transcript persists across runs as designed.

Clearing up a few of your observations

  • The history() “not exposed over HTTP” error is a red herring. That message only means the local harness can’t read the checkpoint (it has no shared checkpoint store). It does not mean session memory is in-process-only. The real memory lives server-side on staging — your run() calls already go there. So once you’re on a build with the fix, run B will recall run A even though history() over the harness still can’t show you the transcript.
  • Token counts were a dead end, as you suspected — the doubling was just the tool round-trip, not run A being replayed. The behavior was the right signal. :+1:
  • [submode: “auto”] injecting user_storage_get even with [tools: []] is expected today. The intended memory model under [auto] is: the transcript (checkpoint) is your long-term conversation memory, and user_storage is an optional KV scratchpad for structured app state you want to manage yourself. You don’t need to persist the codeword manually — that’s the session’s job.
  • A truly tools-free session mode isn’t available yet (you’re right that [fixed] needs a [fixed_client_id]). Noted as a real gap on our side, not something you’re missing.
  • The frame schema is OpenAI-style chunks ([choices[0].delta.content], task_*, [stream_end → [DONE] → end]), not the old [event: “token”/“complete”] shape. Your reading is correct — that’s a docs-lag issue and we’ll get them updated. Thanks for flagging it.

What to do next

Two things, both quick:

  1. Bump your tooling. You’re on CLI 0.1.19; the current pin is already 0.1.26. Your report almost certainly predates the fix being deployed.
  2. Re-run your exact ZEBRA-51029 script against staging once it’s on ≥ beta.39. Run B should answer ZEBRA-51029 directly, no tool call, no manual persistence.

If you’ve upgraded and staging is confirmed on the new build but it still doesn’t recall, ping us — at that point we’d look at whether the checkpoint rows are actually being written for your [aps:] thread, and we’ll dig in with you.

Really appreciate the rigor here — reports like this make the platform better for everyone. Happy building! :rocket: