Skip to content

[Tracking] A2A conformance and promotion to supported #39

Open

Description

@SergeevDmitry

Context & Rationale

The A2A adapter is experimental and serves the Agent Card and SendMessage. A2A 1.0.1 §3.1 lists GetTask, ListTasks and CancelTask among the operations every agent implements, with no capability flag to decline them, and the TCK tests them at MUST level. In 2.8.0 GetTask and CancelTask answer TaskNotFoundError and ListTasks answers UnsupportedOperationError.

SendMessage has two more gaps:

  • It drops tenant and configuration unchecked, although §3.3.2 says servers MUST validate all input parameters.
  • It ignores returnImmediately, although §3.2.2 says the operation MUST return immediately when it is set.

A2A 1.x is the only pinned protocol declared stable by its upstream. Closing these gaps allows core A2A to become supported.

Each checkbox tracks a separate PR; check it when the PR lands.

Proposed Changes

  • Serve GetTask and ListTasks from stored tasks
    • The receipt store gains three optional, experimental methods for task records, kept in a new schema v6 table. A store without them keeps tasks in process memory under the same limits.
      • A record is the task as last answered. Only the pending-task methods make a task payable.
    • Every task the adapter answers is kept:
      • for protocols.a2a.tasks.retentionHours (default 24, 1 to 8760)
      • up to protocols.a2a.tasks.maxRetained records (default 1000)
    • A full store refuses new records and never evicts old ones. Eviction would let a flood of free calls push out a paid result before its buyer reads it.
      • An input-required or immediate-return task needs its record before the adapter acts. If the record does not fit, the request fails with GATEWAY_BUSY before anything executes.
      • A finished task from a blocking call is returned but not kept.
    • What a record holds:
      • It holds the merchant response and the x402 receipts.
      • It never holds the request input, a payment proof or an AP2 presentation.
      • Its size is bounded by the backend executor's 1 MiB response cap, as for stored responses.
      • The docs carry a personal-data note.
    • ListTasks:
      • It pages with an opaque cursor in pageToken.
      • It sorts by status timestamp, newest first.
      • It omits artifacts unless includeArtifacts is set.
      • It filters by status and statusTimestampAfter.
      • Its response always carries tasks, nextPageToken (an empty string on the last page), pageSize and totalSize.
      • An empty page conflicts with the §5.7 rule that a required array holds an element. The support record lists the conflict.
    • Task history is not kept, because the user's message can carry payment proofs. historyLength is validated, but there is nothing for it to cap.
    • After the v6 migration, rolling back to 2.8.x needs the backup taken before the upgrade.
  • Cancel a task that is waiting for payment
    • CancelTask cancels an x402 extension task in input-required.
    • The atomic take of the pending task decides between a cancel and a payment, and only one of them can take it.
    • TaskNotCancelableError (-32002), which the adapter's error table gains, answers in these cases:
      • a payment message has already taken the task
      • the task is running
      • the task is finished
    • Canceling a canceled task returns it again, because §3.3.1 makes cancel idempotent.
  • Answer SendMessage for a known task as the spec requires
    • A message naming a finished or running task gets UnsupportedOperationError (§3.1.1), not TaskNotFoundError.
    • A message naming a task without a contextId takes the task's context. A mismatched pair gets InvalidParams (§3.4.3).
    • An unknown task id keeps TaskNotFoundError (§3.4.2).
    • A payment message that loses the take to a competing message now gets UnsupportedOperationError instead of TaskNotFoundError.
  • Honor returnImmediately
    • With returnImmediately: true:
      1. The adapter stores a TASK_STATE_WORKING task.
      2. It answers with that task.
      3. It finishes the purchase in the background, and GetTask returns the result.
    • Background work would escape the mount's limit of 20 concurrent requests. The adapter therefore applies its own limit of 20 background runs. Past it, the request gets a failed GATEWAY_BUSY task before anything executes.
    • Shutdown waits for running work.
    • A task still marked working by a gateway that has since restarted is reported as failed. Its message tells the buyer not to pay again before checking with the merchant.
  • Validate the remaining parameters
    • Every method checks its parameters before any store read or execution:

      Parameter Answer
      A non-empty tenant UnsupportedOperationError
      taskPushNotificationConfig PushNotificationNotSupportedError
      acceptedOutputModes without application/json ContentTypeNotSupportedError
      pageSize outside 1 to 100 InvalidParams
      A negative historyLength InvalidParams
      An unknown status InvalidParams
      A bad page token or timestamp InvalidParams
    • A proto3 string field at its default value, such as contextId: "", counts as absent.

  • Accept proto field names such as context_id
    • ProtoJSON parsers accept them. The TCK sends them for GetTask, ListTasks and push parameters.
    • Every method renames snake_case keys to camelCase before dispatch, except inside data and metadata. Those hold the merchant's input and the x402 extension's keys.
    • A key sent in both forms gets InvalidParams.
    • A client that relied on context_id being ignored now gets the same refusal as contextId. The changelog notes the change.
  • Scope task access to the caller
    • §13.1 says results MUST be scoped to the caller's authorization boundary. The adapter has no A2A authentication. The task id the gateway issues therefore serves as the access key:
      • Holding the task id authorizes GetTask and CancelTask. Unknown ids get TaskNotFoundError.
      • ListTasks returns tasks only for the supplied contextId. A missing or unknown one gets an empty page.
      • Each SendMessage opens a new context, which limits the page to one task.
    • Task and context ids:
      • They come from randomUUID() directly, bypassing the injectable id generator.
      • They are never logged. Logs carry the request id instead.
    • SendMessage continues to refuse a client-chosen contextId, as §3.4.1 allows.
    • docs/protocols/a2a.md documents this model.
  • Warn on a public http: base URL
    • §7.1 says production deployments MUST use encrypted communication.
    • The Agent Card advertises merchant.publicBaseUrl. doctor warns when that URL is http: and its host is not loopback.
  • Accept X-A2A-Extensions as an alias of A2A-Extensions
    • A2A 1.x registers only A2A-Extensions. The x402 A2A transport and the a2a-x402 library send the X- form instead.
    • a2a-x402 v0.1, its only release, requires the server to echo the URI.
    • Accept either header, and echo both.
  • Run the TCK at MUST level as its own CI job
    • Run run_tck.py --transport jsonrpc --level must from a2aproject/a2a-tck@5e6f37c2:
      • That commit is the first revision that checks A2A 1.0.1. The latest tag, 1.0.0.alpha3, checks 1.0.0.
      • It needs Python 3.15 or later.
    • It runs against a local gateway whose merchant.publicBaseUrl points at itself, because the TCK calls the URL in the Agent Card.
    • Installing it needs PyPI, which keeps it outside npm test and npm run verify. At run time it contacts only the gateway.
    • Every MUST test that runs passes. The support record lists every other result with its reason.
    • The job compares the TCK's JUnit output with that list. Any of these fails the job:
      • an unlisted failure or skip
      • a listed test that passes
      • a listed test that does not run
    • Every TCK test that creates a task sends a text part. The adapter refuses text parts, because its Agent Card declares only application/json.
      • Tests that send a text part fail: CORE-SEND-001, CORE-EXECUTION-MODE-001/002, CORE-MULTI-001a, CORE-MULTI-003, DM-*.
      • Tests that need an existing task skip: CORE-GET-001, CORE-CANCEL-001/002, CORE-SEND-002, CORE-MULTI-005/006, CORE-HIST-*.
      • Our own tests cover what those tests would check.
    • CORE-MULTI-002a also expects an unknown client contextId to be accepted, which contradicts its own title and §3.4.1.
    • Report two problems upstream:
      • the CORE-MULTI-002a runner bug
      • task helpers that ignore the Agent Card's input modes
  • Promote core A2A to supported
    • These become supported in the README, the docs, the descriptor and the support record:
      • the Agent Card
      • the JSON-RPC binding
      • SendMessage and returnImmediately
      • the three task operations
    • The support-record drift test gains a promotion gate. A profile promoted under the criteria needs a stable upstream revision, no open gap, conformance evidence and docs.

Non-goals / Invariants Preserved

  • Streaming, push notifications, the extended card, multi-turn continuation and the REST and gRPC bindings stay unsupported, as the Agent Card's capability flags allow.
  • A2A 1.1 is not served. On 2026-11-22 upstream had a v1.1.0-rc tag and no release.
    • Serving 1.1 beside 1.0 waits for the release.
    • It adds MUSTs for generation, for ifGenerationMatch (TaskGenerationMismatchError, -32010), and for SendLiveMessage and userArtifacts.
  • No A2A authentication scheme. It can come later as an opt-in, and it would allow listing across contexts.
  • No mapping from text parts to resource input.
  • A running task cannot be canceled.
  • reconcile and a manual resolve do not update task records.
  • The x402 extension stays experimental and optional on the Agent Card. a2a-x402's only release is v0.1, and neither it nor the v0.2 draft targets A2A 1.x.
  • A pending task still settles at most once.
  • Task operations never verify, settle or call a backend.

Impact & Value

Done when:

  • every applicable A2A 1.0.1 MUST is implemented or explicitly excluded,
  • the TCK job's results match the support record,
  • and the evidence supports listing core A2A as supported.
Test plan (across the list)

Proto field names:

  • context_id is refused like contextId, both in the params and in the message.
  • A payment with task_id and message_id resumes its task.
  • A field sent in both forms is refused.
  • Snake_case keys inside data.input and metadata reach the backend and the extension unchanged.
  • contextId: "" reads as absent.

Task operations:

  • The TCK's snake_case ListTasks parameters work.
  • ListTasks paging and filters work, and an empty page carries nextPageToken: "" and totalSize: 0.
  • A cancel races a payment on SQLite and in memory. Exactly one succeeds, and a canceled task never settles.
  • A finished task can be read after a restart and is gone after its retention window.
  • A guessed task id gets TaskNotFoundError, even with a predictable id generator.
  • A full store refuses an input-required task and holds nothing.
  • No stored record contains _payment, a proof or a presentation.

returnImmediately:

  • The working task arrives before a slow backend returns.
  • The 21st concurrent background run is refused, and nothing executes.
  • Shutdown waits for running work.
  • A task interrupted by a restart reads as failed, and a replayed proof settles nothing.

Other:

  • Both extension headers activate the extension.
  • A v5 database migrates to v6.

Activity

  1. added
    enhancement
    tracking
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementtracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions