DEV Community

Cover image for How do I pass historical execution context to an external protocol assistant?
Edward Izgorodin
Edward Izgorodin

Posted on Originally published at mnemoverse.com

How do I pass historical execution context to an external protocol assistant?

Send the remote assistant a short brief, and keep the full history where you can read it again: on your side, or in a store both sides can reach. The brief travels in the one request the protocol carries in. In A2A 1.0 that request is a single Message. Put the brief in its text or data parts, name earlier tasks in referenceTaskIds, and reuse the contextId when the remote agent should keep what it already saw, which the specification allows and does not require. Over MCP the brief is a tool argument. For a Claude subagent it is the prompt string.

The brief holds the objective, the decisions with their reasons, the dead ends, a list of what is done and must not be redone, references to sources, the status of each claim and the constraints. In the released A2A 1.0, history and historyLength only control what the server sends back, and neither of them carries history in.

I think of the model weights as the engine. What makes an agent work over time is everything around them: memory, notes, rules, skills, the workspace. Hand the work to an assistant across a protocol, and on the first call the far side has its own engine and its own surroundings, and of yours only the one message. Everything your own agent built up around its engine stays behind, unless you send it or point to where it lives.

Sending everything is the obvious move, and I would not make it, even where a stack accepts the whole transcript. A receiver of a transcript gets all of it, including what it should not see, and it cannot tell what you checked from what you guessed. A brief can say which claims were checked, and you can test whether it arrived.

The field called history

In April 2025 patwlan asked in issue 274: "What is the history field in the Task object?" The specification defines historyLength as "The maximum number of most recent messages from the task's history to retrieve in the response." and adds "The server MUST NOT return more messages than the provided value, but MAY apply a lower limit." The field and the parameter both describe what comes back to the client.

A 1.0 send has no field for earlier messages, because a send carries one message. Sam Betts opened the Coherent Task History epic in issue 1991 on 25 June 2026 with exactly this: "There is no standard way to send a pre-existing message history (e.g. from a chat completions-style API) into SendMessage."

In issue 602, pstephengoogle, a contributor, suggested a workaround: "You could provide the context as a DataPart in the message itself." The same contributor named its cost there, "When you approach it this way, you have tightly coupled the client and the server expectations of structure.", and pointed to an extension instead. For a brief, I think the coupling is a fair price. A brief with a fixed set of fields is a small contract between two agents, and when the remote agent belongs to someone else, its shape can be agreed through an extension declared on the Agent Card. With a whole transcript in a data part, the receiver has to guess the structure of every turn, and nothing on the Agent Card tells it how.

A change is proposed for 1.1 and not released. The draft specification on the dev-1.1 branch says "historyLength (and the history field it controls) is deprecated as of version 1.1 in favour of timelineLength and the task timeline.", and ADR-002 behind the change still carries "Status: Proposed". In 1.0, read history to see what the server kept, and send nothing through it. The same draft says servers keep filling it throughout the 1.x line and remove it in 2.0.

Ten stacks side by side

Each cell below is what the stack's own documentation says; I did not run any of them.

Stack Carries prior context in Returns history to the caller Keeps it between calls Limits and defaults stated
A2A 1.0 One Message per send: text, raw, url or data parts, metadata, referenceTaskIds Task history, bounded by historyLength The remote agent may, per contextId; not required At most historyLength messages, possibly fewer; unset is implementation-defined; not every message is guaranteed to be stored
MCP 2026-07-28 Tool arguments, including server-minted handles Tool results, which may link to resources The server, under a handle the model carries forward No payload limit on the pages read; handle retention belongs in the creation tool's description
OpenAI Responses API Full input, previous_response_id, or a conversation Stored responses, retrievable through the API; store: false turns storage off OpenAI, for previous_response_id and conversations Responses kept 30 days by default; conversations not subject to that TTL; chained input tokens billed
OpenAI Agents SDK handoff, in one process The entire previous conversation by default; input_filter narrows it result.to_input_list() Your code (session) or OpenAI (conversation_id, previous_response_id), not both in one run SessionSettings(limit=N) retrieves the most recent N items; nested handoff history is an opt-in beta
Claude Agent SDK subagent, in one process Only the Agent tool's prompt string The subagent's final report Session files on the machine that created them; a SessionStore adapter can mirror transcripts Not stated on the pages read
LangSmith Agent Server A2A endpoint, for LangGraph A2A text and file parts, into the graph's messages key The whole context's history by default; LangChain's historyScope narrows it to the task The deployment, per conversation; contextId becomes thread_id for tracing historyLength caps at 10; streaming ignores both history options
Microsoft Agent Framework A2A agent task_id for a task awaiting input, reference_task_ids for an earlier one; listed keys in the request metadata Not covered on the page read The caller's session: session.to_dict() keeps context, task ID and task state together No run kwargs sent by default; forwarded metadata is not added to message history
IBM watsonx Orchestrate, external A2A agents A sendHistory setting for conversation history; context variables in message metadata Not covered on the page read Not covered on the page read Agents invoked during a run see no context variables by default; context_access_enabled turns them on
Google ADK A RemoteA2aAgent sub-agent translates between the A2A format and ADK Events; what it sends is not covered on the pages read Not covered on the pages read Each agent's own Session; exposed with to_a2a(), in-memory sessions and an InMemoryTaskStore by default Not covered on the pages read
CrewAI A2A delegation The delegated task, its input_files as FileParts, and a response_model schema in the message metadata The remote agent's result, returned to the CrewAI workflow When exposed as an A2A server, open-source CrewAI keeps task and context state in memory on one process; AMP persists it max_turns bounds turns with the A2A agent; a requested response_model need not be honored

Not covered means only that the pages I read do not describe that point, and says nothing about whether the product has it. The OpenAI Agents SDK and Claude Agent SDK rows are handoffs inside one process. They stay in the table because they show what reaches a receiver by default, and their defaults are opposite. One forwards the entire previous conversation. The other gives the subagent nothing from the parent except a prompt string.

Where the history lives

The A2A protocol leaves this open. The specification says "Agents MAY use the contextId to maintain internal state, conversational history, or LLM context across multiple interactions", and "Agents MAY implement context expiration or cleanup policies and SHOULD document any such policies". So the remote agent may keep the history or leave it to the client, and the A2A issues show both. pstephengoogle described the expectation in issue 602: "The expectation is that the agent you are interacting with is responsible for the conversation history, and is associated with the context_id that it returns with any response (Message or Task)." Kuang Mi, opening issue 2061 on 15 July 2026, described the current behavior the other way: "If a client wants a conversation, it must manually track and resend history." Both are comments by individual people; neither is a decision of the project.

On the first call, assume the remote agent knows only what you send. On later calls with the same contextId, read its documentation for what it keeps and for how long, and rely on nothing it does not document.

LangSmith's A2A endpoint keeps the conversation on the server, and its A2A page tells the client how to continue it: "For all subsequent messages in the conversation, send back the contextId from the prior response and omit taskId, so each turn opens a new task inside the same conversation." The OpenAI Agents SDK separates client-managed history from OpenAI-managed state, and its running agents page warns about mixing the two: "Mixing client-managed history with OpenAI-managed state can duplicate context unless you are deliberately reconciling both layers." Anthropic's Agent SDK sessions page says "Session files are local to the machine that created them." and then gives the advice I would give for any remote assistant: "Don't rely on session resume. Capture the results you need (analysis output, decisions, file diffs) as application state and pass them into a fresh session's prompt."

A third keeper is a store that neither agent owns. The Microsoft ISE team described one in a post of 26 June 2026: "In this pattern, the coordinator retrieves context from the Context Store, optionally summarizes it, and embeds it directly in the message payload." Anthropic's multi-agent research system also keeps work outside the agents: "Subagents call tools to store their work in external systems, then pass lightweight references back to the coordinator." Mnemoverse documents a version of this for A2A on its integration page, where the task carries an explicit domain and "The receiving agent reads memory for that domain before doing work." In that pattern, the same page says, "Mnemoverse is the memory behind your own agents, not an agent they delegate to."

MCP has no implicit keeper. Its basic specification says "The Model Context Protocol (MCP) is a stateless protocol: all the information needed to process a request is contained in the request itself." I wrote about what that means across client connections in an earlier article.

Whichever keeper you pick, name one for each piece of history and pass its key on every call: the contextId, the thread, the conversation or the store's namespace. OpenAI wrote its warning about duplicated context for one SDK. I read it as advice for every stack in the table.

Size and retention limits are left to implementations. An open issue 2220 of 9 September 2026 says "The spec defines no bounded limits for several protocol inputs that map directly to server-side storage and memory." The stated ones are few: LangSmith caps historyLength at 10, and OpenAI keeps responses for 30 days by default.

The handoff brief

Anthropic's subagents page states the constraint that holds for any remote assistant on a first call: "The only content you pass from parent to subagent is the Agent tool's prompt string, so include any file paths, error messages, or decisions the subagent needs directly in that prompt." Pawel Twardziak put it more briefly on the LangChain forum on 16 September 2026: "Hand off a typed brief, not free text." and "Pass paths, not content."

The brief I would send has seven fields. The list is mine; each source quoted here gives one or two of the fields. In typed form:

{
  "objective": "what to do, the form of the answer, where the task ends",
  "decisions": [{ "decision": "...", "reason": "..." }],
  "dead_ends": [{ "tried": "...", "error": "..." }],
  "done": [{ "step": "...", "idempotency_key": "..." }],
  "references": { "tasks": ["..."], "files": ["..."], "commits": ["..."] },
  "claims": [{ "claim": "...", "source": "...", "status": "observed | inferred | unchecked" }],
  "constraints": [{ "rule": "...", "check": "branch, HEAD, file hashes" }]
}
Enter fullscreen mode Exit fullscreen mode

For the objective, Anthropic's research system gives the list I would use: "Each subagent needs an objective, an output format, guidance on the tools and sources to use, and clear task boundaries."

Decisions travel with their reasons. In a thread on r/AI_Agents of 26 October 2026, jordimr described a handoff note of this kind: "Right now it's decisions, rejected approaches and next steps. Constraints are the part I'm least sure about." I would add the reason to every decision. I keep the working rules for my coding agents in CLAUDE.md files in my repositories, each with the date it was added and the reason. Without the reason, a later reader cannot judge whether a rule still applies, and an assistant on the far side of a protocol is always a later reader.

Dead ends need the error message, so the receiver does not repeat them.

The done list is the one field I would not drop. In the same thread, vladgladi described it as "a list of things that are already done and must not be redone." and gave the reason: "Without it the agent happily resends the same email or reruns the same migration, because nothing told it that step already happened." Put the idempotency key next to any step with side effects.

Wherever a reference can replace content, send the reference: earlier task IDs in referenceTaskIds, artifacts as url parts, file paths, commits. A reference can go stale. In the A2A specification, the error for an unknown task ID says it "might be invalid, expired, or already completed and purged." A handle also has to survive your own summarizing. SEP-2567 of MCP names the failure: "if the conversation is summarized and the handle is in the discarded portion, the state is orphaned."

Every claim gets a status, as axonpush put it further down the thread: "keep the claim linked to its source and mark whether it was observed, inferred, or still unchecked."

Constraints were the part jordimr was least sure about. In the same thread axonpush wrote "i'd give constraints a different shape from progress notes.", and ChemicalExcellent463 described how to keep a note honest: "i carry a handover note with the branch, HEAD and file hashes, and have the next agent check those against the checkout first.", because "the note doesn't get to overrule the repo." That last sentence is the rule I would apply to any handoff that touches code.

One alternative to fields is a rolling summary, and its cost is documented. In the Microsoft ISE post, the coordinator summarizes the conversation history after every 10 turns before embedding it, and the authors warn that "Every summarization step can lose important details or introduce inaccuracies, potentially degrading the quality of downstream responses." So I would let a summary cover the conversation and copy the seven fields through each handoff unchanged.

The brief also decides what the receiver never sees. OpenAI's handoffs page says: "Treat the receiving agent and its model provider as recipients of the forwarded history." The Microsoft ISE post names what a selective handoff gains: "Sensitive information from one part of the conversation can be excluded from the context sent to a specific agent."

Testing the handoff

HelpfulCollar1070 gave the core of a test in the same r/AI_Agents thread: "start a fresh session with only the notes and ask it to explain the project back to you." Over a protocol it needs a control as well, because a remote assistant can know things from somewhere other than the brief.

  1. Plant two markers in the brief: one made-up decision with its reason, and one item on the done list.
  2. Send the brief on a new context (in A2A, without a contextId, so the server mints one) and ask the assistant to state the objective, the decisions and what it will not redo.
  3. Ask for the next step. It must not repeat the done item.
  4. Fetch the task with a small historyLength and compare what the server kept with what you sent. The specification does not guarantee that every message is stored, so a gap there is not by itself a failed handoff.
  5. For the control, send the same request on another new context without the brief. The assistant must not know the made-up decision. If it does, history reached it another way, through a context the remote side kept or a store both sides read; find out which before you trust step 2.

I read the sources quoted here on 5 November 2026 and the Mnemoverse integration page again on 20 November, and the text describes them as they stood on those days. What A2A itself defines, and why shared memory stays a separate layer, is on the Mnemoverse library page A2A Protocol (Agent2Agent), Explained.

I work on Mnemoverse; in this text it is one of the external stores, described from its public documentation like the others.

Top comments (0)