Upgrading from 0.12 to 0.13

0.13.0 makes the event log the record and spends it on stream resumption. Nine breaking items. The first is the one most code will meet; the third is a rename you fix at the read site; the last five were found by an audit after the first three were written down, and two of them are attributes or types that only bite a match or a binding; the other three change behaviour. The ninth shipped in 0.13.0 but was listed under [Unreleased] until 2026-09-23; its section is the last below.

RequestContext is #[non_exhaustive], and gains call_context

Building one with a struct literal from outside a2a-protocol-server stops compiling. cargo semver-checks check-release -p a2a-protocol-server --baseline-version 0.12.1 ran 196 checks in the run recorded when this was written and failed one, struct_marked_non_exhaustive on this type. That run was not exhaustive: the PurgeReport rename below makes struct_pub_field_missing fire too. The added field is not a second finding: once a struct is #[non_exhaustive] an added field is no longer separately observable.

// 0.12 — a struct literal, from outside the crate
let ctx = RequestContext {
    message,
    task_id,
    context_id,
    stored_task: None,
    metadata: None,
    cancellation_token: CancellationToken::new(),
};

new takes the three fields with no sensible default; everything else has a with_*:

#![allow(unused)]
fn main() {
use a2a_protocol_server::RequestContext;
use a2a_protocol_types::{Message, TaskId};

let ctx = RequestContext::new(
    Message::user_text("msg-1", "3 + 5"),
    TaskId::new("task-1"),
    "ctx-1".to_owned(),
)
.with_metadata(serde_json::json!({ "tier": "gold" }));
let _ = ctx;
}

with_stored_task and with_call_context are the other two in 0.13; later releases add more with_* setters. Reading a RequestContext is unaffected — the fields are still public, so an executor that only reads ctx.message needs no change. The attribute is deliberate rather than incidental: this type grows, and every previous growth would have broken a literal nobody writes.

EventQueueReader::read yields a StreamEvent, not a StreamResponse

The event now travels the queue with the position it holds in the task's log: StreamEvent { seq: Option<u64>, event: StreamResponse }. Reattached::Channel and the persistence channel carry the same type. Only code that matched the result of read() directly is affected.

// 0.12
while let Some(Ok(StreamResponse::StatusUpdate(update))) = reader.read().await {
    handle(update);
}

Reach through .event for a value, or .map(|e| e.event) for the Result:

#![allow(unused)]
fn main() {
use a2a_protocol_server::{EventQueueReader, InMemoryQueueReader};
use a2a_protocol_types::StreamResponse;

async fn drain<R: EventQueueReader>(reader: &mut R) {
    while let Some(Ok(ev)) = reader.read().await {
        if let StreamResponse::StatusUpdate(update) = ev.event {
            // `ev.seq` is the number the store wrote and the SSE `id:` carries.
            println!("{:?} {:?}", ev.seq, update.status.state);
        }
    }
}
let _ = drain::<InMemoryQueueReader>;
}

StreamEvent is itself #[non_exhaustive], so destructure it with .. or — as above — reach through .seq and .event.

seq is None for frames the server synthesized rather than the agent emitting — the SubscribeToTask snapshot, and the terminal frame the reattach hook builds from stored state. Those are not in the log, so they carry no id: and a resuming client's offset is unaffected by having seen them. It is a type change rather than an accessor because the position has to be the same number the store wrote, and the only way to guarantee that is to assign it once and carry it.

PurgeReport::journal_orphans_deleted is now orphan_rows_deleted

The retention sweep reclaims two side tables now, not one — the artifact journal and the event log — so the old name described half of what the number counts. Renamed rather than kept and widened: a field whose name names one of its two sources is read as the count for that source.

// 0.12
tracing::info!(orphans = report.journal_orphans_deleted, "retention sweep");

Rename it at the read site. The meaning is unchanged for anyone who had only the journal:

#![allow(unused)]
fn main() {
use a2a_protocol_server::store::PurgeReport;

fn summarize(report: &PurgeReport) -> String {
    format!(
        "{} tasks, {} orphan side-table rows, complete={}",
        report.tasks_deleted, report.orphan_rows_deleted, report.complete,
    )
}
let _ = summarize(&PurgeReport::default());
}

It is still normally zero: both side tables carry an ON DELETE CASCADE, so a non-zero count means rows outlived their task — which happens on a SQLite pool handed to from_pool without foreign_keys=ON.

IdempotencyClaim and KeyError are #[non_exhaustive]

Both are enums a caller matches on. A match from outside the defining crate now needs a wildcard arm — and should name it, because a future variant reaching a silent catch-all is how a new outcome gets folded into the wrong one.

IdempotencyClaim is also re-exported from a2a_protocol_server::store now, beside RecordedEvent. It is the return type of a TaskStore method, so an out-of-tree store has to name it, and it was reachable only at store::task_store::IdempotencyClaim.

use a2a_protocol_server::store::IdempotencyClaim;
use a2a_protocol_types::task::TaskId;

fn describe(claim: IdempotencyClaim) -> String {
    match claim {
        IdempotencyClaim::Claimed => "create the task".to_owned(),
        IdempotencyClaim::Replay(id) => format!("return {id}"),
        IdempotencyClaim::Conflict { held_by } => format!("refuse; held by {held_by}"),
        // Required from 0.13. Naming it beats a silent fallthrough.
        other => format!("unhandled claim outcome: {other:?}"),
    }
}
fn main() { let _ = describe(IdempotencyClaim::Replay(TaskId::new("t"))); }

FailureClass::ALL is a slice

It was [FailureClass; 5], so the length was in the type and the sixth variant would have broken every caller that bound it — the break #[non_exhaustive] on the enum exists to prevent.

use a2a_protocol_types::failure::FailureClass;

fn tokens() -> Vec<&'static str> {
    // was: for c in FailureClass::ALL
    FailureClass::ALL.iter().map(|c| c.as_str()).collect()
}
fn main() { assert!(!tokens().is_empty()); }

build() refuses a signed agent card it would have to edit

The builder advertises the extensions this server can honour by appending to capabilities.extensions, and a card signature covers everything except signatures — so appending to a card that is already signed leaves the served card canonicalizing to bytes nobody signed, and every client that verifies it fails while this side reports nothing.

Declare the extensions before signing. A card that already declares them builds and is served byte-identical to what was signed.

use a2a_protocol_types::extensions::AgentExtension;
use a2a_protocol_types::failure::FAILURE_EXTENSION_URI;
use a2a_protocol_types::idempotency::IDEMPOTENCY_EXTENSION_URI;

fn example(card: &mut a2a_protocol_types::agent_card::AgentCard) {
// Before signing, not after:
card.capabilities.extensions = Some(vec![
    AgentExtension::new(IDEMPOTENCY_EXTENSION_URI),
    AgentExtension::new(FAILURE_EXTENSION_URI),
]);
}
fn main() {}

Declare IDEMPOTENCY_EXTENSION_URI only when the store you configure reports supports_idempotency(); FAILURE_EXTENSION_URI is advertised on every server. From 0.15 the builder also advertises BUDGET_EXTENSION_URI on every card (see A signed agent card declares the budget extension), LEASE_EXTENSION_URI when a lease store is configured and APPROVAL_EXTENSION_URI when an approval gate is; a signed card must declare each of them.

A keyed message/send is retried only against a peer that advertises it

RetryTransport treated any valid key in Message.metadata as making the send retryable. The key rides in a field A2A defines as free-form, and the extension is not part of A2A v1.0, so a conformant peer from another SDK ignores it and runs the send — and the retry starts a second task.

ClientBuilder::from_card reads the advertisement and enables it for you. For a client built on a bare endpoint, assert it only for a peer you know implements the extension:

use a2a_protocol_client::ClientBuilder;

fn example() -> Result<(), a2a_protocol_client::error::ClientError> {
let client = ClientBuilder::new("http://localhost:8080")
    .with_peer_honouring_idempotency(true)
    .build()?;
let _ = client;
Ok(())
}
fn main() {}

message.id is validated at ingress

It is checked like context_id and task_id now — non-empty after trimming, and within HandlerLimits::effective_max_message_id_length(), which is max_id_length but never below 36, the length of a UUID, so tightening max_id_length does not refuse conformant clients. It was checked nowhere, so an empty messageId was accepted, stored, and echoed in task history, where every empty id collides with every other.

No code change is needed unless you were sending empty or very long message ids. If you generate them, uuid::Uuid::new_v4().to_string() is what the examples use.

RetentionPolicy and PurgeReport are #[non_exhaustive]

The ninth item. RetentionPolicy was missed by 0.12's conversion of the configuration structs, and PurgeReport is marked for the same reason: both gain fields (idempotency_key_max_age, idempotency_keys_deleted) that would otherwise have broken a literal. It shipped in 0.13.0, but the changelog listed it under [Unreleased] until 2026-09-23, so the 0.13.0 release notes do not mention it.

Build a policy with new and the setters, and read a report's fields rather than destructuring it without ..:

#![allow(unused)]
fn main() {
use std::time::Duration;
use a2a_protocol_server::store::RetentionPolicy;

let policy = RetentionPolicy::new(Duration::from_secs(7 * 24 * 3600))
    .with_batch_size(500);
let _ = policy;
}

Also in 0.13, not breaking

  • TaskStore gains nine methods, all defaulted. Six for the event log (supports_event_log, append_event, last_event_seq, read_events, earliest_event_seq, event_log_covers) and three for idempotency (supports_idempotency, claim_idempotency_key, release_idempotency_key). A custom store keeps compiling, and the defaults report no support rather than a successful claim or an empty log — so forgetting to implement them cannot quietly produce a send that runs twice or a resumption that silently skips events.
  • bindings/a2a-protocol-slimrpc moves to 0.5.0, pinned to 0.13. It is outside the root workspace and versioned independently, so this is not a break of the four published crates; it bumps in this release rather than after it because the binding depends on the workspace by path as well as by version, and ^0.12 stops resolving the moment the crates read 0.13.0. See its chapter.

Back to Upgrading Between Minor Versions.