Appearance
0006. A2UI and the vymalo extensions in adam-rs ​
Status: Accepted (2026-10-01), decided on the owner's delegation; the owner may revisit. Amended 2026-10-02 (ADR 0015): decision 8's list of card entries gains mentions/v1; a source can say more about its tools than a spec (ToolSource::listing, kept with the model's answer, not a step of its own, so "Journaling the tool listing" below still stands), add words to the instructions, and a call waits as long as the tool says, capped, with a stable callId. Amended 2026-10-02 (ADR 0016): decision 8's list of card entries gains steer/v1; a message sent to a running task is read at its next step, and a message of the run is read once. Amended 2026-10-11 (ADR 0035): decision 6's choices is a form with a title, a description of why the agent asks, typed questions (radio buttons, checkboxes, a searchable list, a deck of pictures, a typed answer), options of up to 12 (50 in a list, 16 pictures in a deck) and a free box; what is sent depends on the version of the screen's catalog; an answer may carry text and a note. Amended 2026-10-17 (ADR 0036): decision 2's keys gain vymalo.caller, who a message was sent for, read from the caller and depth claims of the thread-tools token (main, ask:<n>, or unreadable); the token is still a secret that no log, result or model sees, and decision 3 is unchanged. Amended 2026-10-17 (ADR 0036, Built 2026-10-17): decision 2's keys gain vymalo.person, what the person wrote in the thread, read from the person member {said, omitted?} that the orchestrator writes beside the grant of an asked agent's message (null for a message with the grant and no well-formed member, so an earlier message's words go); the coder hears only those words in a run another agent started. Decision 3 is unchanged. Builds on ADR 0001 (libraries first, binaries compose), ADR 0003 (a new task carries the conversation) and ADR 0005 (adam-agent). The other side of the contract is the orchestration layer's: ADR 0013 (A2UI), ADR 0023 (the UI catalog as an A2A extension, its status note) and ADR 0024 to 0026 of vymalo/another-agentic-system, and its pages docs/api/ui-catalog-v1.md and docs/api/thread-tools-v1.md.
Context ​
The orchestration layer's chat can draw more than text. The web owns a catalog of components (Text, Column, Choices today; Cards and Mermaid next), the orchestrator relays it to an agent in the A2A messages it sends, and it serves one MCP endpoint per conversation (the thread tools) through which an agent reads the catalog again and, in later slices, uses the tools of the servers the person attached and asks other agents. All of it is optional A2A extension machinery, detected from the agent's card, so a plain A2A agent keeps working.
What adam-rs had, verified 2026-10-01 by reading the code at commit bec4044:
- No A2UI anywhere.
ask_user { question }wasToolError::NeedsInput { question }, and aninput-requiredstatus carried the question as text only (adam-a2a-runtime/src/convert.rs). default_inboundturned an A2A message into{"text": ...}, with data parts printed as JSON text: a message's metadata (where the extensions live) never reached the agent, and an A2UI action arrived as JSON.Tool::spec()is one fixed spec per tool, so a tool list that changes from one turn to the next (the tools of the thread's endpoint) could not be offered to the model.adam-mcpconnected the servers of anmcp.jsononce, at startup.
Decision ​
- A question can carry an interface.
ToolError::NeedsInputandPendingQuestiongain an optionalui(an array of A2UI messages), journal- and state-compatible (absent in old records, not written whileNone). Aninput-requiredstatus message is the question as a text part and the interface as anapplication/a2ui+jsondata part, in both spellings of the media type (mediaTypeof A2A 1.0 and the extension'smetadata.mimeType); the status message id and the "did anything change" key include a digest of the interface, and a status without one is exactly what it was. - What a message says about its sender is the run's inbound context. The objects under
"context"of every inbound payload are merged, key by key (nulldeletes), into the durableConversation::context, carried byConversation::continued(a new task of the same conversation has the catalog and the grant of the one before), bounded to 256 KiB, and read by tools withToolCtx::context.adam-a2a-runtime'svymalo_inboundfills it from the extensions of a message:vymalo.ui.ref(ui-catalog/v1),vymalo.ui.catalog(an inline catalog with the ref's id, read underv0.9,v0.9.1andv1.0capability keys because A2UI's own files disagree on it),vymalo.threadTools({url, token, expiresAt}). It also reads an A2UI action as the person's answer: Choices answers becomeThe person answered through the interface:and a line per question (- db: pg), any other actionThe person used the interface: action "<name>" ...(Amended 2026-10-11, ADR 0036: only the actionanswerof a surfaceask-<identifier>is an answer, and its first line names the surface:The person answered through the interface (form ask-<call id>):). A2A servers hold metadata numbers as doubles (maxLength: 256.0): whole numbers are written back as integers, which is what a catalog's digest is over. - The thread-tools token is kept in the run's state until it expires. The token must survive the split between the A2A front and the worker that steps the run, and a restart, so it is stored in the context (the durable state of the run, in Postgres) and removed once its
expiresAthas passed, at the start of the next step (Conversation::drop_expired_context: any context entry that is an object with anexpiresAt). It is never in a log line, a tool result, an error message or the model's context; itsDebugprints[redacted]. This is the first alternative of the orchestration layer's risk R4 (the other, dropping it and refetching only inside the process that received the message, breaks the front/worker split). A parked run keeps an expired token until it next steps. - Dynamic tools are a
ToolSourceread at every model turn.adam-llm-agentgains the trait:specs(ctx)lists the tools to offer on this turn (read from the run's context, inside the journaled model step, so a replay lists nothing and the journal has no new entries),call(ctx, name, args)answers the calls to them inside the journaled tool step. The agent's own tools come first and win a name clash; at most 64 are offered. The thread-tools client (adam_ui::ThreadTools) is one: it lists the endpoint'stools/listeach turn and offers every listed tool under its listed name, so the relayed tools of attached servers andask_agentof later slices appear with no change here.adam-assembly'sBoundDef::tool_sourcegives a source to every agent. Amended 2026-11-19 (P14 of the 2026-11-18 optimisation review): the listing is still read inside the journaled model step, but it is kept for the grant that read it (adam_ui::LISTING_TTL, 60 s, never past the grant'sexpiresAt) and reused by later turns; a new grant (a reconnect), a call the endpoint refuses, or the TTL lists again. A stateless endpoint cannot announce a tool-set change, so one is seen at the next session or TTL. - One
showtool, not one tool per component. The catalog is the screen's and changes with its version; a model's tool list should not, and a screen is several blocks together.ui_catalog {}gives the components and their schemas;show { blocks, title? }takes{component, ...properties}blocks, validates each against the catalog's JSON Schema (jsonschema, draft 2020-12, no network resolution) and answers a refusal in words the model can act on; a good call is a run artifactuiof media typeapplication/a2ui+jsonunder the screen'scatalogId.ask_usergainschoices(up to 8 questions, 2 to 8 options each) rendered as one Choices surface; on a screen that cannot draw it, the options go in the question's text. Every tool degrades; none fails a run. - The catalog is checked against its digest, always, and refetched when stale. A catalog read from a message or from
get_ui_catalogmust hash (canonical JSON: sorted ASCII keys, whole numbers, no whitespace; RFC 8785 restricted to what a catalog holds) to the digest it was announced with, or it is not used. The tools look at the run's context, then at the catalogs this process holds (by digest, 8, in memory), and when the current catalog is neither inline nor held they read it once over the thread tools. An expired, missing or refused grant, an endpoint that is down or a document that does not hash are all "unreadable": the tool degrades to text. - The endpoint is an MCP server under the deployment's policy.
adam_mcp::Endpointopens a connection per request (the endpoint is stateless and the token is per message), applies the rules of every remote server (https, or plainhttponly to this machine unlessMCP_ALLOW_INSECURE; no credentials in the URL) and scrubs the token from everything it returns. - The extensions are announced on the card, and only the card.
adam_ui::card_extensions()is A2UI v0.9.1 (withsupportedCatalogIdsandacceptsInlineCatalogs: true),ui-catalog/v1andthread-tools/v1, all optional (ADR 0008 of the orchestration layer: detected live from the card, fail closed, removable). Nothing else in the process depends on them being listed: an agent whose card lists none gets messages without the metadata, and its tools answer in text.
Consequences ​
- Breaking for code that builds
ToolError::NeedsInput,PendingQuestionorConversationwith a struct literal (a new field each);ToolError::needs_input(question)andneeds_input_with_ui(question, ui)are the constructors. Old journals and old state load unchanged, and a question with no interface writes the shape it always had. - The token is at rest in the store for as long as its lifetime (the orchestration layer's default is two hours), and in the A2A inbox of the run until the message is consumed. A deployment that cannot accept that does not list
thread-tools/v1on its card. - The tool list a model sees can change between turns, but not between a call and its replay: the listing is not journaled (only the model's answer is), and the call is. An agent that was given a source mid-run (a deploy) can fail the replay of a turn that was in flight, as a change of
tools:can (ADR 0004). jsonschemajoins the build (MIT; its dependencyborrow-or-shareis MIT-0, added todeny.toml's list).MCP_ALLOW_INSECUREis needed by a stack whose orchestrator is reached over plainhttpinside a cluster network, for the thread-tools URL as for any MCP server.- A source's tool cannot wait on a remote task (
ToolError::AwaitRemote): the agent polls the tool that started the task, and a source's tool is not known then. The relayed tools of the next slices are plain calls.
Alternatives considered ​
- One tool per component. Rejected (decision 5): a tool list that follows the catalog's version, and a model that has to compose a screen out of several calls.
- Hard-wiring
get_ui_catalogas the only thread tool. Rejected (decision 4): the orchestration layer adds tools to the same endpoint, and an agent that lists none of them is not using the endpoint. - Dropping the token and refetching only inside the receiving process. Rejected (decision 3): it breaks the front/worker split that ADR 0001 is about.
- Journaling the tool listing. Rejected: it adds a step to every turn of an agent with a source and changes the journal sequence of runs in flight; not journaling it costs nothing, because only the model's answer is replayed.
- A hand-written validator for the catalog's schemas. Rejected: the catalog is JSON Schema 2020-12 the web authors and a library says what the web's validator says.
Verified and unverified ​
- Verified 2026-10-01, by tests in this repository: the digest of the web's real catalog (version 2, a copy in
crates/adam-ui/tests/fixtures) is the one its lock names and the contract's known-answer vector hashes as documented; doubles hash as the integers they are; rmcp 3.5's client works against rmcp 3.5's own stateless server (NeverSessionManager, JSON responses) mounted withroute_serviceon the parametrised path/thread-tools/{thread}/mcp; a stateless endpoint is served one connection per request; a whole agent behind A2A asks three questions as one form, takes the answer as an action and goes on; the token reaches neither the model nor the person. - Verified 2026-10-01 against A2UI's files (
github.com/google/A2UImain, asui-catalog-v1.mdrecords): the capability key isv0.9in the JSON schema andv0.9.1in the extension page; adam reads both. - Unverified: how a real model uses
choicesandshow(the tests script the model); the web's drawing of the surfaces (the orchestration layer's tests); a 401 is told apart from other failures by the text the transport reports.
Status notes ​
2026-10-02, from the owner's chats of that day (a model guessed a component name, drew a form that nobody could answer and then blamed the screen, and called two tools for one catalog). Three changes, none of them to the contract:
showis described with the screen's components. The description a model reads names each component of the conversation's catalog with the first sentence of what it is for (at most 2 KiB, then "and n more"), so a block names a component that exists on the first call;ui_catalogstill gives the schemas. A tool's description is made when the agent is built, and the catalog is the conversation's, so the new hook is a defaulted method ofToolSource,refine(&SourceCtx, &mut [ToolSpec]), called once per model call (inside the journaled step, so a replay reads nothing), andUi::source()uses it to rewrite the description ofshowfrom the catalogs this process already holds: no turn asks the endpoint for the sake of a description. The first turn of a conversation whose catalog is only referenced and not held yet is described as before ("callui_catalogfirst"); that call, or any tool that reads the catalog, holds it, and the next turn lists it.showrefuses aChoicesblock. The screen enables a form only while the conversation is blocked on one (ask_user), so a form drawn byshowis a dead form. The refusal says so and namesask_userwithchoices, and the description says it too. (A later option, the web letting an action on a finished thread start the next job, would change this and not the refusal's reasoning today.)get_ui_catalogis not shown to the model.Ui::source()hides it (ThreadTools::hiding) and answers a call to it as a name nobody has: the model hasui_catalog, and two tools for one thing made it call whichever it remembered. The refetch of a stale catalog still goes through the endpoint, inside this crate. The other way round (hiding the local tool) was rejected:ui_catalogworks with no grant, from the message's own catalog, andget_ui_catalogdoes not.