Repository navigation
feat: implement coherent task history — timeline + artifact ordering (ADR-002) - #2129
Conversation
31d3e31 to
b93e539
Compare
Add a generation-ordered TimelineEntry collection to Task. Each entry is a oneof - an agent TaskStatus (streamed via the existing TaskStatusUpdateEvent, so no new wire event) or a client Message - and is extensible to more entry kinds later. Widen the generation definition so appending a timeline entry increments it.
Add an Elicitation collection and ElicitationState (WAITING/BLOCKED/ RESOLVED) to Task so input-required flows are modeled explicitly, deriving INPUT_REQUIRED without changing the TaskState enum.
Annotate Artifact with start_generation/end_generation so artifacts interleave with the timeline without per-chunk events, and add an origin role to preserve the input/output distinction for client-written (bidirectional) artifacts.
…002) Now that the timeline records both agent status entries and client messages, it supersedes history. Soft-deprecate Task.history and the three history_length request params, and add timeline_length to SendMessageConfiguration, GetTaskRequest, and ListTasksRequest. Deprecated fields stay populated/honored through the v1.x line and are removed in 2.0.
e8e8f5f to
45da163
Compare
…DR-002) Add specification prose for the coherent task history model: Task Timeline Semantics (TimelineEntry oneof of TaskStatus/Message, ordered by generation, delivered via the existing TaskStatusUpdateEvent so no new event type), Elicitation Semantics, artifact start/end generation interleaving, the history/historyLength deprecation in favour of timeline/timelineLength, and the widened generation mutation set. Add object sections for TimelineEntry, Elicitation, and ElicitationState.
Put the client Message case first (field 1) and TaskStatus second (field 2) in the TimelineEntry oneof, in both the proto and the spec prose.
Add a repeated Elicitation delta field to TaskStatusUpdateEvent so elicitation creations and state changes reach streaming clients without a new event type, identified and merged by elicitation_id. Document creation timing, identity/monotonic states, delivery, and tighten generation semantics so elicitation changes are delivered rather than only reconciled.
Move the elicitation delta from TaskStatusUpdateEvent onto TaskStatus, so it
is delivered via the status update and captured in the timeline (each status
entry records what changed), reconstructing elicitation history without a new
event type or repeating the full set. Keep Task.elicitations as the
authoritative current set. Trim Elicitation to {elicitation_id, state,
metadata}: request_message_id is redundant (co-located with status.message)
and generation is implied by the status the delta appears in.
…ferred elicitation-resolution note (ADR-002) Clients MUST skip a TimelineEntry whose oneof kind they do not recognise (its generation still counts, so ordering/gap-detection keep working), documented in both the proto comment and the timeline semantics. Remove the out-of-scope note about how a client indicates which elicitation an input satisfies.
vinoo999
left a comment
There was a problem hiding this comment.
I think we should remove Role from artifacts and Elicitation altogether. Seeking clarification on Artifact generation firmly tying it to a Task and how generation increments from client side invocations. Curious on alternatives to TimelineEntry of Message and if all we are really missing from History is the idea that it can be repeated Message | Event. Artifact updates are missing from Timeline Entry which may be desirable but will lead to a non-1:1 relation in entry to generation increments.
Remove the origin role field from Artifact (defer client-written/bidirectional artifacts to the bidi work, per review) and tighten the start/end_generation comments.
…y (ADR-002) Fix a stale proto comment that listed an Elicitation state change as a separate generation mutation (it is part of a status update now), and state explicitly that timeline-entry generation values are monotonic but not contiguous - Artifact updates also advance generation, so gaps between entries are expected and artifacts are placed via start/end_generation.
…e (ADR-002) State the elicitation -> TaskState mapping explicitly: INPUT_REQUIRED while at least one elicitation is BLOCKED, with WAITING leaving the state unchanged so the agent can keep working. Framed as implementation guidance (typically an SDK default) rather than a protocol requirement, and not conditioned on the negotiated version. Corrects earlier text that treated WAITING and BLOCKED alike.
Remove Elicitation, ElicitationState, Task.elicitations and the TaskStatus elicitation delta, plus their spec sections, so this PR covers only the coherent timeline. Elicitations move to a follow-up PR where they can be reviewed on their own merits.
|
/vote |
Vote created@herczyn has called for a vote on The members of the following teams have binding votes:
Non-binding votes are also appreciated as a sign of support! How to voteYou can cast your vote by reacting to
Please note that voting for multiple options is not allowed and those votes won't be counted. The vote will be open for |
Vote statusSo far Summary
Binding votes (0)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
2 similar comments
Vote statusSo far Summary
Binding votes (0)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (0)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (1)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (1)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (1)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (1)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (2)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (2)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (2)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
4 similar comments
Vote statusSo far Summary
Binding votes (2)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (2)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (2)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (2)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote statusSo far Summary
Binding votes (5)
|
| User | Vote | Timestamp |
|---|---|---|
| vinoo999 | In favor | 2026-08-19 11:29:16.0 +00:00:00 |
| herczyn | In favor | 2026-08-19 13:15:03.0 +00:00:00 |
| Tehsmash | In favor | 2026-09-07 8:35:36.0 +00:00:00 |
Vote closedThe vote passed! 🎉
Summary
Binding votes (5)
|
) ## Summary Extends the SLIMRPC binding with a layered set of specs and an example for collaborative multi-agent sessions. No new RPC methods are defined — the relay works with `SendStreamingMessage` (A2A 1.0+) for broad compatibility, and upgrades to `SendLiveMessage` bidi streaming (A2A 1.1) when available. The specs are layered from most-general to most-specific: ``` spec/v1/a2a-shared-task.md ← base primitive: multi-client single-agent task spec/v1/a2a-collaborative-task.md ← multi-agent relay (extends shared-task) spec/v1/slimrpc-collaborative-task.md ← SLIMRPC profile: capability-driven mode selection spec/v1/slimrpc-multicast.md ← SLIMRPC multicast SendLiveMessage (fan-out, no relay) spec/v1/slimrpc.md ← base SLIMRPC binding (point-to-point) ``` --- ### `spec/v1/a2a-shared-task.md` — A2A Shared Task extension Defines the primitive that collaborative-task is built on: a single `Task` on a single agent addressable by multiple clients simultaneously. Key points: - **No new A2A methods.** Works with `SendMessage` / `SendStreamingMessage` (A2A 1.0+). The A2A SDK already fans all events to all active subscribers on a task. - **`message-sender` metadata key.** Namespaced under the extension URI in `Message.metadata`; carries the identity of the sender of each message. - **Extension URI:** `https://a2a-protocol.org/extensions/shared-task/v1` --- ### `spec/v1/a2a-collaborative-task.md` — A2A Collaborative Task extension Transport-neutral spec for output-to-input relay between N agent tasks. Key design points: - **All-to-all mesh topology.** No pipeline or star; all participants see all messages. - **Three relay tiers** (in order of preference): - *Native fan-out*: transport delivers peer `StreamResponse` items to all members natively — no relay process. Requires A2A 1.1. - *Live relay*: relay uses `SendLiveMessage` (A2A 1.1) — relay holds open send stream per agent. - *Basic relay*: relay uses `SendStreamingMessage` + `SendMessage(context_id, return_immediately=True)` injection (A2A 1.0+). Broadest compatibility — works with any A2A agent. - **`message-sender` attribution** carried in `Message.metadata` under the shared-task extension URI. Application code MUST NOT set or override it; the transport or relay populates it. - **Session ID rewriting.** Each agent independently assigns its own `contextId` / `taskId`; the relay rewrites both into every translated item before delivery. - **Extension URI:** `https://a2a-protocol.org/extensions/collaborative-task/v1` ### Peer event translation table | Peer sends | Translated to | Parts | | :--- | :--- | :--- | | Initial `Task` | `StreamRequest { message }` | 1× `Part.data` (`application/vnd.a2a.task+json`) | | `TaskStatusUpdateEvent` with message | `StreamRequest { message }` | Original parts + appended `Part.data` (`application/vnd.a2a.task-status-update+json`) | | `TaskStatusUpdateEvent` without message | `StreamRequest { message }` | 1× `Part.data` (`application/vnd.a2a.task-status-update+json`) | | `TaskArtifactUpdateEvent` | `StreamRequest { artifact_update }` unchanged | — | | `TaskMessageUpdateEvent` | `StreamRequest { message }` (original parts + appended envelope) | Preserve original `message-sender` | --- ### `spec/v1/slimrpc-collaborative-task.md` — SLIMRPC Collaborative Task profile Maps the generic spec onto SLIM. Key points: - **Capability-driven mode selection (§3).** Before initiating a session, the client inspects each agent's Agent Card to determine the transport mode: | Participant capabilities | Mode | | :--- | :--- | | All agents declare SLIMRPC binding + all three collaborative-task extension URIs | **Native** — shared-responses GROUP channel, no relay | | Some SLIMRPC-capable, some not | **Hybrid** — shared-responses GROUP for SLIMRPC agents + p2p relay for others | | None SLIMRPC-capable | **Full relay** — point-to-point A2A connections only | - **Activation signal (§4).** `a2a-extensions: https://a2a-protocol.org/bindings/experimental-slimrpc/extensions/collaborative-task/v1` in SLIMRPC call metadata. Applies to both `SendLiveMessage` and `SendStreamingMessage` on SLIM group channels. - **`message-sender` in `Message.metadata` (§5.1).** Populated from SLIM transport `src` field by the runtime. Application code MUST NOT set it. - **`slimrpc-context-map` (§5.2).** SLIMRPC session-level call metadata on the initial streaming call; used for session continuation only. - **MUST NOT declare SLIMRPC collaborative-task URI unless started with shared-responses (§8).** Declaring the URI signals native-mode eligibility; an agent not in shared-responses mode cannot participate correctly. --- ### `spec/v1/slimrpc-multicast.md` — Multicast `SendLiveMessage` Fan-out `SendLiveMessage` over a SLIM group channel: each agent's `StreamResponse` flows back to the initiating client only; agents are unaware of one another's output. Unchanged from prior version. --- ### `examples/collaborative/incident-response/` Four-agent incident response example (monitoring → log → diagnostics → remediation). All relay logic lives in `collaborate_transport.py`: ```python async for slim_name, response in collaborate(client_factory, agent_cards, request_stream): ... ``` `collaborate()` inspects Agent Cards and selects the mode automatically: ```python try: client = client_factory.create(agent_cards) # ValueError → nstreams if isinstance(client, MulticastClient) and all_slimrpc_capable: # native: shared-responses GROUP channel, no relay else: # multicast relay: GROUP channel, app relay re-injects peer responses except ValueError: # nstreams: N p2p SRPCTransport instances, app fan-out relay ``` `make_agent_card(shared_responses=False)` conditionally declares the SLIMRPC collaborative-task URI — only when `shared_responses=True` — enforcing the MUST NOT rule from spec §8. --- ### Related - A2A 1.1 bidi streaming foundations: [a2aproject/A2A#2153](a2aproject/A2A#2153) - A2A 1.1 coherent task timeline (ADR-002): [a2aproject/A2A#2129](a2aproject/A2A#2129) - Follow-up — `contextId` correlation for `SendMessage`/`SendStreamingMessage` multicast: [#7](#7)
…tics (#2270) ## Summary Clarifies that task states are **terminal** or **non-terminal**, and that the interrupted states `TASK_STATE_INPUT_REQUIRED` and `TASK_STATE_AUTH_REQUIRED` are **non-terminal**. A non-terminal task stays under the server's control: the server **MAY** keep processing it and transition it to any other state — including out of an interrupted state — without a message from the client, and **MAY** keep accepting messages directed to it. Entering a non-terminal state does not necessitate closing a streaming response. Prose-only. No new types, fields, or enum values, and no wire change. ## Motivation The interrupted states are already labelled "interrupted" in `a2a.proto`, and the streaming operations (§3.1.2, §3.1.6) already close a stream only on a terminal state. But the SSE binding prose (§11.7) said the stream closes on "a terminal **or interrupted** state", and the spec never stated plainly what terminal vs. non-terminal means. That left implementors inferring a stricter, client-driven model than the protocol requires — e.g. that `INPUT_REQUIRED` ends the turn and closes the stream. Nothing in the protocol prevents sending a message to a task in an interrupted state, or an agent moving a task out of an interrupted state on its own. The server owns the task lifecycle; sending to a running task is otherwise underspecified for interop (#1992). This PR states the rule once, at the `TaskState` level, so bindings have a single thing to implement against. It also unblocks the input-required discussion and complements the steering extension (#2125). ## Changes - `specification/a2a.proto` — `TaskState` enum comment: define terminal vs. non-terminal/interrupted at the lifecycle level. Per-state comments unchanged. - `docs/specification.md` §4.1.3 — matching normative definition under the enum table. Delivery-agnostic; streaming stays in the streaming operation. - `docs/specification.md` §3.1.2 — in the Task lifecycle stream, a non-terminal/interrupted state SHOULD NOT by itself close the stream (terminal still MUST). - `docs/specification.md` §11.7 — drop "or interrupted" from the SSE close rule; point to §3.1.2. ## Breaking change? Drafted as SHOULD NOT (not MUST NOT) so no conforming implementation is invalidated. The only behavioral shift is for servers that close the SSE stream on an interrupted state today (see Appendix). Opening a vote to record whether this counts as breaking. ## Non-goals - Elicitations — deferred to an extension (ADR-002 / #2084). - Deprecating `TaskStatus.message` — how an agent describes the requested input is a docs concern, not this change. - Blocking `SendMessage` / `return_immediately` semantics — unchanged. - Steering an actively `WORKING` task — separate extension, #2125. ## Appendix: current SDK behavior (server side) Which SDK server implementations end a streaming response when a task enters an interrupted state: | SDK | Closes on `input-required`? | Closes on `auth-required`? | Where | |---|---|---|---| | a2a-python `DefaultRequestHandlerV2` (default) | No | No | `active_task.py` — `INTERRUPTED_TASK_STATES` kept disjoint from `TERMINAL_TASK_STATES`; stream handler has no state-based break | | a2a-python `LegacyRequestHandler` | Yes | No | `event_consumer.py: consume_all()` — `is_final_event` set includes `INPUT_REQUIRED` (#167) | | a2a-go | Yes | No | `internal/taskupdate/final.go: IsFinal()` → `state.Terminal() \|\| state == TaskStateInputRequired` | | a2a-js | Yes | No | `execution_event_queue.ts: events()` stop set = `TERMINAL_STATE_LIST \|\| INPUT_REQUIRED_STATE_LIST` (AUTH excluded) | | a2a-dotnet | Yes | Yes | `TaskUpdater.cs` — `RequireInputAsync()` and `RequireAuthAsync()` both call `eventQueue.Complete()` | - `auth-required` is already broadly compliant; only a2a-dotnet closes on it. - `input-required` is the divergence: only a2a-python V2 (the default) keeps the stream open; go, js, python-legacy, and dotnet close. - Bringing an SDK in line is small and wire-neutral: drop `input-required` from the stop predicate (`IsFinal` in go, `events()` in js, `consume_all` in python-legacy), and stop calling `Complete()` in dotnet's `RequireInputAsync`/`RequireAuthAsync`. SHOULD NOT → MUST NOT is a candidate for a later minor once these converge. Related: #2084, #2129, #1992, #2125. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <[email protected]>
…#2322) ## Summary Lets a client write artifacts (including multiple artifacts in one call, or chunked updates) over both live streams and unary/server-streaming calls, split out of #2153 so the live channel can be reviewed on its own. Because `StreamRequest` in #2153 embeds `SendMessageRequest`, extending `SendMessageRequest` once enables client-written artifacts across `SendMessage`, `SendStreamingMessage`, and `SendLiveMessage` alike. ## What's here 1. **`SendMessageRequest.artifact_updates` (`repeated TaskArtifactUpdateEvent`)** — lets a client send work-item artifacts alongside a control `message` (for example `"please translate this doc"` + the doc when creating a task) or on their own when continuing an existing task (`task_id` set). - `message` is required when creating a task (when no `task_id` is provided, as the agent needs a control message to know what to do with the artifacts); it may be omitted only when sending `artifact_updates` to an existing task. - When `message` and `artifact_updates` are sent together and a `Task` is created/updated, `message` is appended to `timeline` first, followed by `artifact_updates` in list order. If the agent responds with a direct `Message` without creating a `Task`, neither is persisted in a task. 2. **`AgentCapabilities.user_artifacts` (`optional bool`)** — indicates whether the agent accepts client-written (`ROLE_USER`) artifacts in `SendMessageRequest.artifact_updates` (otherwise `UnsupportedOperationError` / `StreamError`). 3. **`generation` ownership** — on each client-sent `TaskArtifactUpdateEvent`, `generation` is server-owned: clients MUST leave it unset, servers MUST ignore any value received, and the server stamps the authoritative value when broadcasting the resulting `TaskArtifactUpdateEvent` downstream. 4. **`Artifact.role`** — restored so a client-written artifact (`ROLE_USER`) stays distinguishable from an agent output (`ROLE_AGENT`, the default). Deferred out of the history ADR (#2129) for this change. ## Verification `buf breaking` (FILE) clean, api-linter `problems: []`, protolint clean, markdownlint clean. Related: #1995, #2153
Fixes #1991
Summary
Implements the coherent task history model from ADR-002 (#2084, tracking #1991) in the proto (
specification/a2a.proto) and the normative spec prose (docs/specification.md), on top of the mergedgenerationfield (#1810). Additive and backward compatible, and deliberately introduces no new wire event: the timeline reuses the existingTaskStatusUpdateEventfor delivery.Design (why it's non-breaking)
The
timelineis a restructuring of the Task snapshot, not a new event on the wire.TimelineEntryis aoneof:Message message— client messages recorded in the task.TaskStatus status— agent status progression (state + the agent'smessage), delivered by the existingTaskStatusUpdateEvent.This matters because a new member of the stream event union is not safely ignorable today: a2a-go, a2a-java and a2a-rs all hard-error on an unrecognised event (java's
StreamingEventKindis asealed interface), a2a-python raises on strictParseDict, and a2a-js / python-gRPC silently drop it. Reusing an existing event avoids that entirely.TaskStatus.messageis retained (not deprecated): the "latest status message" pollution problem is solved by the timeline retaining the full ordered sequence of statuses rather than just the head.What's included
TimelineEntry{ oneof { Message message; TaskStatus status } int64 generation }+repeated TimelineEntry timelineonTask. Widensgenerationso appending a timeline entry increments it (previously onlyTaskStatetransitions and artifact add/update counted, so a progress message that doesn't change state wouldn't advance it).start_generation/end_generationonArtifact, so artifacts are placed relative to timeline entries without per-chunk events flooding the timeline.historydeprecation — the timeline supersedes it, soTask.historyand the threehistory_lengthparams are soft-deprecated andtimeline_lengthadded. Deprecated fields stay populated/honored through v1.x, removed in 2.0.TimelineEntryobject section.Notes for reviewers
TimelineEntrywhoseoneofkind they don't recognise (itsgenerationstill counts), so future entry kinds are additive.Artifact.rolewas dropped from this PR and deferred to bidi, per review.Related: #2084 (ADR-002), #2149 (elicitations), #1810, #1794