Skip to content

Release v0.6.0 - #322

Draft
MisterVVP wants to merge 10 commits into
mainfrom
release/v0.6.0
Draft

MisterVVP wants to merge 10 commits into
mainfrom
release/v0.6.0

Conversation

@MisterVVP

Copy link
Copy Markdown
Owner

TBD

…318)

## Summary

Closes #268.

Completes opt-in asynchronous unary server execution for v0.6.0.
Applications implement `CoroutineAgentExecutor` with Boost.Asio C++20
`awaitable<Result<T>>` methods and supply an Asio executor to
`AsyncDispatcher`. Native `AsyncGrpcServerTransport` connects that
engine to gRPC unary reactors without waiting for backend completion on
a reactor thread or allocating one SDK worker per pending request.

The callback-based async application executor and its Asio bridge have
been removed. `AsyncDispatcher` directly awaits `CoroutineAgentExecutor`
methods. Native gRPC reactor callbacks, transport completion handlers,
and cancellation observers remain at integration boundaries. Existing
synchronous `AgentExecutor`, `Dispatcher`, transports, and streaming
registration remain source-compatible and available without Boost.

## Architecture and lifecycle

- Transport-neutral request metadata, cancellation, deadlines, and
terminal arbitration live in `a2a::server::engine`. The application
receives an owned execution context; first-terminal-transition
precedence and exactly-once completion remain authoritative through late
backend cleanup.
- Eight application unary operations use typed coroutine results,
including void deletion. Extended agent-card retrieval uses the shared
provider, completing all nine unary dispatcher operations.
- Synchronous and coroutine dispatch share routing, payload validation,
authorization, history projection, and interceptor policies. An internal
session keeps each request's authenticated principal separate from
pipeline configuration. Before hooks run in registration order and after
hooks in reverse order. Existing synchronous exception propagation is
preserved; async finalization contains after-hook exceptions.
- RAII admission reservations distinguish logically active requests from
pending coroutine cleanup. Cancellation releases active capacity before
transport completion, while pending capacity stays reserved until
physical cleanup; construction and initial scheduling failures release
their reservations.
- Both gRPC transports share unary request/response conversion,
metadata/auth and extension validation, task-list conversion,
error/status mapping, and status-details serialization. Reactor
ownership, cancellation, and streaming remain with their transports.
Existing operation-specific error diagnostics are preserved.
- Applications can supply their own Asio executor or use the optional
`AsyncRuntime` owner, which runs a fixed-size Boost.Asio thread pool.
The owning application shuts down and drains the runtime; suspended
frames retain their application and pipeline until cleanup completes.
Cancellation remains cooperative.
- The optional `BlockingExecutorAdapter` exposes a synchronous,
thread-safe `AgentExecutor` through the coroutine contract. Its
Boost.Asio backend pool has explicit worker and queued-plus-running
capacity limits. It calls application operations directly without nested
dispatch. Cancellation completes the transport logically while running
blocking calls retain their capacity until physical cleanup. This is
bounded worker adaptation, not nonblocking network or database I/O, and
does not restore the removed callback executor API.
- The optional `a2a::asio` target requires Boost 1.92 or newer and C++20
standard-library cancellation. Boost's license and notices are included;
the SDK remains Apache-2.0. CI includes feature-enabled and
feature-disabled builds and the previously fixed Windows/macOS
compatibility paths.

## Conformance setups and limits

The existing `tck_sut` retains synchronous execution, streaming, and all
three transports. The separate `tck_async_sut` uses the coroutine engine
and registers SDK transports directly, sharing application fixtures,
stores, policies, providers, and listener infrastructure with the
synchronous setup.

The async setup currently enables gRPC only. HTTP serves agent-card
discovery/caching, and JSON-RPC/HTTP+JSON operation routes are
unavailable. Unsupported transport selections fail at startup; the card
advertises only enabled capabilities. A small awaitable bridge moves
blocking fixture application/store operations onto the existing bounded
backend queue and delivers results on the awaiting executor. This does
not provide async database or outbound network I/O.

Async HTTP scheduling (#270), streaming (#169), outbound clients (#269),
and async database stores (#266) remain separate work. Downstream
registration, ownership, supported-platform guidance, installed-consumer
examples, and reproducible sync-versus-async thread/latency evidence are
documented under `book/src/server/`.

## Validation

The local results below were recorded during implementation.
Current-head CI results are linked separately below.

- Canonical `A2A_VERIFY_POSTGRES=1 A2A_VERIFY_BUILD_DIR=build
./scripts/verify_changes.sh`: 927 registered tests, zero failures; two
expected TLS-without-SUT skips. Includes native gRPC lifecycle/race
cases, synchronous transports, PostgreSQL, installed consumers,
examples, and fixture runtime tests.
- Exact CI formatting and explicit `./scripts/run_clang_tidy.sh build`:
passed with Clang 19. The local lint cache keys successful analyses by
tool/configuration, compile commands, and translation-unit dependency
content. Ubuntu Clang 19 / GTest 1.14 readability and complexity checks
also pass.
- Eleven additional regression tests cover separate authentication
sessions, after-hook exception policies, request ownership and
typed/list/void response conversion, mismatched payloads, independent
active/pending admission, and fixture result/error/executor delivery.
- ThreadSanitizer: 80 focused dispatch, fixture, conversion, and session
tests pass without suppressions.
- Follow-up `523240c`: the chunk-callback shutdown test now holds the
SSE stream open and verifies cancellation, eliminating the EOF/shutdown
race in its success assertion. The affected 30-test HTTP TSAN suite and
200 repeated executions passed locally. Canonical validation, explicit
lint, formatting, TCK, and performance smoke also passed. The complete
CI ThreadSanitizer profile has passed on the current head.
- Official TCK start/run/stop flow on in-memory and PostgreSQL stores:
synchronous three-transport setup **249 passed / 16 skipped** per store;
async gRPC setup **68 passed / 197 skipped** per store. Zero executable
failures across all four runs.
- Required gRPC + HTTP/JSON performance smoke: **54 scenarios, zero
errors**. Before/after immediate-dispatch benchmark samples remain
within observed run-to-run variation on the shared runner.
- `mdbook build book`: passed. Boost dependency and vcpkg
manifest/configuration changes are included; Python tooling `pip-audit`
reports no known vulnerabilities. This is not a complete automated C++
dependency advisory audit.

All six pull-request workflows have completed successfully on the
current head, `d47aa3435b`:
[CI](https://github.com/MisterVVP/a2a-cpp/actions/runs/41131982984),
[TCK
Conformance](https://github.com/MisterVVP/a2a-cpp/actions/runs/41131983004),
[CodeQL](https://github.com/MisterVVP/a2a-cpp/actions/runs/41131982983),
[Docs](https://github.com/MisterVVP/a2a-cpp/actions/runs/41131983074),
[Tutorials](https://github.com/MisterVVP/a2a-cpp/actions/runs/41131982985),
and [Commit
messages](https://github.com/MisterVVP/a2a-cpp/actions/runs/41131982986).

The previously approved TCK registry-coverage baseline remains explicit:
synchronous reports show 80.9% MUST / 80.0% overall coverage; the
narrower async gRPC reports show 59.8% MUST / 61.5% overall. Upstream
report tables group untested requirements under “Failed”; no executed
requirement fails. Passing executable tests does not claim complete
registered-requirement coverage.

## Authorship and AI usage

- [ ] Contains substantive content written by a human
- [x] Contains substantive content generated by an AI agent

## Checklist

- [x] Docs updated if behavior changed
- [x] `./scripts/verify_changes.sh` passed locally
## Summary

Closes #169.

Adds opt-in coroutine server streaming for `SendStreamingMessage` and
`SubscribeToTask` to the existing Boost.Asio executor and native gRPC
callback service. Applications await owned event writes and return a
terminal result. Existing synchronous executors, sessions, dispatchers
and transport registrations remain source-compatible.

- `AsyncDispatcher::DispatchStream` reuses the #268 request context,
terminal arbitration, admission limits, validation, authentication and
interceptors. After hooks run once at stream completion. Shared
authorization helpers recheck stored task visibility before each event,
and write failures remain authoritative even if an application ignores
them.
- Native gRPC stream reactors retain each protobuf through
`OnWriteDone`, permit one outstanding write, defer `Finish` until that
write completes, and delete themselves in `OnDone`.
Cancellation/deadlines and host shutdown use the existing request
lifecycle. A stalled native write is cancelled so it cannot hold host
drain; its application context retains the shutdown outcome while the
wire may report `CANCELLED`. Pending coroutine cleanup retains its
admission reservation. The async path has no blocking `Next`, watcher,
polling or per-stream SDK worker.
- Async task subscriptions share the synchronous publication core,
snapshot, event order and terminal rules. Their buffers are bounded;
overflow explicitly fails the slow subscriber without holding publishers
or other consumers. Startup/store work in the TCK fixture uses fixed
backend workers, while live delivery suspends on publication and write
demand. This does not provide asynchronous database I/O.
- The unified async TCK setup now advertises gRPC streaming.
Documentation and the installed-package example cover opt-in
registration, event ownership, demand, cancellation and shutdown. CI
includes the streaming tests in its sanitizer profiles. HTTP/SSE
scheduling remains #270.

## Authorship and AI usage

- [ ] Contains substantive content written by a human
- [x] Contains substantive content generated by an AI agent

## Testing

- Canonical PostgreSQL-enabled `./scripts/verify_changes.sh`: **985
tests passed, zero failures** (two expected TLS-without-SUT skips).
- Exact repository formatting and explicit `./scripts/run_clang_tidy.sh
build` with LLVM 19: **passed across 71 production and 89 test/example
translation units**. The local runner executes the unchanged checks for
every translation unit in parallel and reuses successful results only
when tool, command, source and header content fingerprints match.
- Clang 19 AddressSanitizer + UndefinedBehaviorSanitizer: **29 streaming
checks passed**, including native RPCs, SDK-client interoperability,
slow-reader cancellation, non-reading-client host drain, and the
independent-thread publication/cancellation race.
- ThreadSanitizer: **17 streaming checks passed**, without suppressions.
- Official TCK start/run/stop flow, both in-memory and PostgreSQL
stores:

  | Setup | Passed | Skipped | Executed failures |
  | --- | ---: | ---: | ---: |
  | Synchronous, all three transports — per store | 249 | 16 | 0 |
  | Coroutine unary + streaming, gRPC — per store | 83 | 182 | 0 |

The coroutine setup executes 15 more tests than the prior unary-only
setup. Upstream registry requirements without tests remain explicit
coverage gaps; passing executable tests does not claim complete
registered-requirement coverage.
- Required gRPC + HTTP/JSON performance smoke: **54 scenarios, zero
errors**.
- `mdbook build book`: passed. Python tooling `pip-audit`: no known
vulnerabilities. Dependency manifests are unchanged.

### Reproducible c64 evidence

`async_stream_execution_evidence 64` compares synchronous and coroutine
gRPC subscriptions with the same publication core, metadata and two
events per stream. Both modes use one channel and synchronous client
reads, without adding a client thread per stream. A Linux Debug run
using GCC 15.3, gRPC 1.51.1 and Boost 1.92.0 produced:

| Mode | Application threads | Process threads before → pending |
First-event p95 | Completion p95 | Errors |
| --- | ---: | ---: | ---: | ---: | ---: |
| Synchronous | 64 | 9 → 73 | 0.35 ms | 7.78 ms | 0 |
| Coroutine | 2 | 12 → 12 | 0.33 ms | 2.71 ms | 0 |

The coroutine completion result meets the 10 ms target for this
workload. Measurements include shared-runner scheduling and sequential
client draining; they are not a general latency guarantee. The
executable and reproduction instructions are included under `tests/` and
`book/src/server/async-streaming.md`.

## Checklist

- [x] `./scripts/verify_changes.sh` passed locally
- [x] Docs updated if behavior changed
Refs #232; combines its four checkpoints in one PR targeting
`release/v0.6.0`.

Windows outbound libcurl requests now use `WSAPoll`, a coalesced TCP
wake connection and steady-clock deadlines. Socket generations discard
stale readiness, and orderly EOF drains buffered response data. New
connections start between readiness/cancellation turns to prevent
Winsock connection checks from delaying ready work. The existing CURLM
ownership, bounded shard/dispatch pools and public APIs are preserved.

Regression coverage includes timers, wakeups,
cancellation/completion/shutdown races, 96 simultaneous transfers on one
reactor, and HTTP+JSON/JSON-RPC streaming. Windows CI compares prebuilt
native/fallback binaries in both execution orders and provisions enough
TCP ports for the 28,320-stream workload.

The release branch also needs the A2A 1.0.1 protocol corrections shared
with #324: HTTP+JSON media types, HTTP/gRPC error bindings and SUT
input-media validation. Protocol strings are centralized across the
touched transports, benchmark tooling and fixtures. Wire values and
benchmark budgets are preserved, and test expectations remain
independent.

Validation:
- [SDK
CI](https://github.com/MisterVVP/a2a-cpp/actions/runs/42262766833)
passed, including Windows, both macOS builds, sanitizers,
interoperability and coverage.
- [Native benchmark
reports](https://github.com/MisterVVP/a2a-cpp/actions/runs/42262766833/artifacts/13525827221)
pass strict and cloud budgets in both orders, with all 28,320 samples
and zero errors. Earlier native attempts occasionally missed the strict
16-stream startup budget; latency remains dependent on libcurl, Winsock
and runner scheduling.
- Local canonical verification: 781 registered checks, with three
expected skips; formatting, explicit clang-tidy, mdBook, dependency
audit and all 54 performance-smoke scenarios pass. The callback gRPC
regression suite also passes all 35 checks.
- [Windows build and comparison
instructions](https://github.com/MisterVVP/a2a-cpp/blob/perf/windows-curl-readiness-232/book/src/streaming/windows-reactor.md).

Unmodified upstream TCK at `104a7b4ae0d83f65c075e3793e322953a830eaba`
reports **242 passed, 4 failed, 17 skipped**. Remaining upstream defects
are [CORE-SEND-003's missing expected
error](a2aproject/a2a-tck#202) and the [legacy
Content-Type
assertion](https://github.com/a2aproject/a2a-tck/blob/104a7b4ae0d83f65c075e3793e322953a830eaba/tests/compatibility/core_operations/test_error_handling.py#L777).
TCK runs without local assertion patches or skipped failures.
@MisterVVP MisterVVP linked an issue Nov 6, 2026 that may be closed by this pull request
11 tasks
Add callback unary calls and Agent Card discovery using the shared libcurl reactor and native gRPC callbacks. Preserve synchronous APIs and document cancellation, ownership, and measured performance tradeoffs.

All fifteen CI jobs, CodeQL, documentation, tutorials, and commit-message checks pass. TCK retains the explicitly approved upstream baseline exception; no assertions, skip rules, or script exit statuses were changed.

References #269. Leave issue #269 open at the maintainer's request.
@MisterVVP MisterVVP linked an issue Nov 7, 2026 that may be closed by this pull request
12 tasks done
## Summary

Implements #267 with opt-in asynchronous HTTP push delivery and
coroutine server integration. Existing synchronous delivery keeps its
public API, payload, authentication, version fallback, and result/error
mapping.

- Reuses the shared HTTP async/libcurl multi infrastructure and bounded
completion runtime, with owned requests, cancellation, one
timeout/deadline across fallback attempts, and deterministic shutdown.
- Adds an awaitable service helper that propagates request-context and
Asio cancellation, including cancellation between starting delivery and
registering the result wait. Accepted outbound requests are cancelled
when the coroutine exits early.
- Adds fake-requester and localhost tests, a reproducible
thread/resource comparison, and API/lifecycle documentation.
- Keeps API/lifecycle explanations in the SDK guide and removes
explanatory inline comments from the implementation and tests. Attempt
state and completion results avoid redundant heap allocations.

## Authorship and AI usage

- [ ] Contains substantive content written by a human
- [x] Contains substantive content generated by an AI agent

## Testing

- CTest: 1,068 entries, zero failures; conditional skips retained.
- Regression coverage reproduces the pre-wait cancellation leak against
the original code and verifies cancellation cleanup after the fix.
- The idle-stream shutdown fixture waits for server-side write
acknowledgement before shutdown. Its strict `UNAVAILABLE` assertion
passed 100 consecutive runs.
- No-libcurl build: 26 push delivery/contract checks passed.
- Performance smoke: 54 result rows across gRPC/HTTP+JSON and in-memory
storage, zero errors.
- Optimized localhost comparison at 64 held-open deliveries: synchronous
delivery used 74 process threads and async delivery used 10, with zero
errors. Both modes use the same webhook, payload, and response-release
barrier.
- mdBook build and CI-compatible formatting passed.
- Extracted repeated assertions in an existing Asio gRPC route test to
satisfy the enforced complexity limit; the checked routes and expected
statuses are unchanged.
- `./scripts/verify_changes.sh` and `./scripts/run_clang_tidy.sh build`
passed locally. The original profiles and real clang-tidy checks run
concurrently, with a local cache keyed by preprocessed inputs, compiler
flags, and dumped configuration.

Upstream mandatory TCK (`--level must`, all three transports, in-memory
store) at `104a7b4ae0d83f65c075e3793e322953a830eaba`: **212 passed, 13
skipped, 4 failed**, with unchanged upstream assertions and no
repository-added skips. These match the two assertion defects documented
in `book/src/compatibility/conformance.md`: CORE-SEND-003 omits its
expected error (three transport failures), and HTTP_JSON-ERR-001
requires legacy `application/json` despite the binding's
`application/a2a+json` media type. This is not 100% TCK compliance;
creating this PR with these known failures was explicitly authorized.

Dependency manifests are unchanged. An OSV Scanner scan of a CycloneDX
inventory covering four installed direct C++ dependencies was attempted;
lookup was blocked by the environment's denied access to `api.osv.dev`.
No successful vulnerability-scan result is claimed.

## Checklist

- [x] `./scripts/verify_changes.sh` passed locally
- [x] Docs updated if behavior changed
## Summary

Adds the opt-in `EventHttpServer` listener in `a2a::asio` for HTTP+JSON,
JSON-RPC, discovery, and finite/live SSE. The shared incremental byte
codec preserves the blocking adapter API, while existing transports
provide routing, validation, authentication metadata, protocol errors,
and event serialization.

One network thread and a fixed application pool bound connections,
pending work, input/output buffers, and admission. Persistent and
pipelined requests retain response order. Receive EOF drains active
responses, including finite SSE, and buffered requests before closing.
TCP resets still cancel live production. Awaited event writes provide
backpressure; native dispatcher cancellation wakes a pending socket
write and closes its connection, with exactly-once completion on the
awaiting executor. Delayed cancellation cannot affect a completed write
or another stream generation. Disconnects, rejected responses, producer
failures, idle expiry, and shutdown cancel pending production. Retained
stream handles reject writes after completion or listener destruction.
Synchronous extended-card requests preserve structured HTTP 500 errors
and activated-extension headers when no dispatcher is configured; native
preparation remains independent of a synchronous dispatcher. Socket
shutdown precedes close.

The async TCK fixture uses the SDK listener. Includes native socket
tests, an installed consumer example, lifecycle documentation, and a
reproducible benchmark runner.

The listener currently accepts HTTP/1.1. HTTP/2 clients can connect
through a reverse proxy with an HTTP/1.1 upstream; native HTTP/2 framing
and multiplexing remain outside this implementation.

## Authorship and AI usage

- [ ] Contains substantive content written by a human
- [x] Contains substantive content generated by an AI agent

## Testing

- `./scripts/verify_changes.sh`: exit 0; 1,103 registered tests, zero
failures, three existing skips, including installed-consumer tests.
- Exact CI clang-format dry run and `./scripts/run_clang_tidy.sh build`:
exit 0. Unchanged translation units reuse input-validated clang-tidy 19
results from this session.
- New regression tests verify native cancellation during a backpressured
SSE write releases the producer before listener shutdown, preserves
listener availability, and races safely with peer reset and listener
shutdown. The cancellation regression fails on the previous
implementation and passes with this fix.
- Regression tests also cover send-half-close after the first SSE event,
pipeline draining, reset cancellation before shutdown, all extended-card
aliases and their wire-error headers/body, ordinary unary error
compatibility, and native preparation without a synchronous dispatcher.
- Native cancellation stress: 100 repetitions of each of three new cases
(300 executions), checking exactly-once cleanup and native executor
affinity. Earlier lifecycle stress covered ten cases (1,000 executions),
including 32 live streams with one native worker and one HTTP
application worker.
- Default SDK build with Asio and curl disabled: passed.
- Required gRPC/HTTP+JSON performance smoke: 54 rows, zero errors.
- `mdbook build book`: passed.
- Current head `a92a9b2`: the focused ThreadSanitizer job passed all 334
cases, including all 23 `EventHttpServer` lifecycle tests and the three
native cancellation/race regressions. The profile explicitly builds the
HTTP test executable when Asio is enabled; no suppressions were added.
- Previous head `60c9e7f` passed all 15 main CI jobs, including Windows,
macOS/Asio, ASan/UBSan, interoperability, and performance, plus CodeQL
and documentation checks. Remaining workflows for the current revision
are tracked in CI.
- Dependency manifests and pins are unchanged. Online OSV access remains
proxy-blocked (CONNECT 403).

Comparable optimized c1/c16/c64 and idle measurements reported zero
workload errors. Total fixture threads stayed at 21 versus 73 for the
synchronous baseline at 64 clients. Short c1 finite SSE is materially
slower: 2,986 versus 7,963 requests/s, completion p99 0.581 versus 0.236
ms. Bounded backend dispatch, executor hand-offs, and awaited
socket-write acknowledgements add scheduling cost relative to inline
connection-thread execution. The runtime remains opt-in; these
shared-host measurements do not claim throughput parity.

## Existing TCK failures

The unmodified upstream TCK `104a7b4ae0d83f65c075e3793e322953a830eaba`
reports **242 passed, 17 skipped, four failed** on gRPC, JSON-RPC, and
HTTP+JSON, identically to a clean `release/v0.6.0` at
`40e70a239d18208e07738abb64415d9d97e1a601`. Per-requirement statuses
match the baseline.

- The REST error-format test expects `application/json`; the existing
serializer returns `application/a2a+json`.
- `CORE-SEND-003` fails on all three transports because upstream omits
its expected-error declaration and treats the unsupported-content error
as unexpected.

No TCK expectations were changed. Mandatory conformance is not 100%. The
baseline failures and blocked online vulnerability scan remain
unresolved.

## Checklist

- [x] `./scripts/verify_changes.sh` passed locally
- [x] User documentation updated
)

## Summary

Finalize SDK v0.6.0 metadata, the optional vcpkg `asio` feature,
consumer setup, dependency requirements, and migration guidance. Retain
the completion-timer fix for expired calls awaiting callback cleanup.

HTTP+JSON errors now use `application/json`. The generic conformance
agent advertises `*/*` input support and retains opaque message parts
without decoding them, satisfying the current mandatory TCK expectations
without changing upstream tests.

Reduce async overhead by combining response headers and the first
available SSE event within the output bound, caching each JSON-RPC
stream prefix, and recycling Asio write allocations. Ready in-memory SUT
operations run directly on the coroutine executor; other stores retain
bounded blocking adaptation. Earlier changes also remove redundant
completion allocations and metadata copies and reuse HTTP idle waits.
PostgreSQL storage is unchanged.

Refs #328.

## Authorship and AI usage

- [ ] Contains substantive content written by a human
- [x] Contains substantive content generated by an AI agent

## Testing

- `./scripts/verify_changes.sh`: 1,173 tests passed, three intentional
skips; full formatting and clang-tidy passed.
- Initial stream data is checked for ordering and bounded fallback
writes. Existing cancellation, backpressure, shutdown, metadata, and
installed async consumer checks passed.
- Clean mdBook build passed.
- Unmodified upstream TCK `104a7b4ae0d83f65c075e3793e322953a830eaba`:
mandatory selection passed with 215 passed, 14 skipped, 34 deselected,
no failures.
- Full upstream suite: 244 passed, one failed, 18 skipped. The remaining
`HTTP_JSON-SVC-001` SHOULD check expects `application/a2a+json` where
the mandatory `HTTP_JSON-ERR-001` check requires `application/json`. The
SDK follows the mandatory expectation; the full suite's nonzero exit
status remains visible.
- Windows/macOS execution, the combined PostgreSQL vcpkg install, and
C++ dependency vulnerability scanning remain unverified.

## Checklist

- [x] `./scripts/verify_changes.sh` passed locally
- [x] Docs updated if behavior changed
…333)

## Summary

Closes #332. Based on `release/v0.6.0`, including #331.

The existing performance CI job compares sync and async servers for
every supported in-memory wire workload. Paired throughput, latency, and
resource tables keep raw runs in JSON/CSV instead of duplicating
Markdown rows. PostgreSQL remains sync-only; its storage is unchanged.

- **Both performance steps now run once**, and normal runner comparisons
default to one pass. CI's broad matrix drops from **2,292 to 764 rows**;
sustained coverage drops from **234 to 78**. Scenario coverage,
concurrency levels, warmup, and three-second sustained measurements are
preserved. Explicit local repetitions remain available for variance
analysis.
- Single-run summaries say so and show throughput ranges as `n/a`.
Operation errors now print their scenario, transport, client/server
modes, and counts before comparison validation returns failure.
- Warm the measured clients through the selected API. GetTask and both
ListTasks workloads support all four client/server combinations through
bounded async callbacks; streaming retains its common observer API.
Include 100 ms held subscriptions, measuring cancellation latency
separately.
- Retain the two small SDK changes: move parsed HTTP requests into
handlers while preserving connection policy, and recycle gRPC
write-acknowledgement allocations.

## Recalculated results

Fresh **single-pass local measurements**, with two CPUs divided equally
between driver and server; these are observations, not variance
estimates. The SDK code is unchanged by this follow-up.

- Broad in-memory matrix: **480 rows, 480,000 operations, zero errors**.
- Sustained matrix: **78 rows (72 wire), 1,617,371 wire operations, 36
complete server-mode pairs, zero errors**.

GetTask at concurrency 64, operations/second:

| Transport | Sync client / sync server | Sync client / async server |
Async client / sync server | Async client / async server | Fully async /
fully sync |
| --- | ---: | ---: | ---: | ---: | ---: |
| grpc | 23,756 | 26,746 | 24,339 | 32,788 | 1.38× |
| http_json | 12,356 | 14,168 | 13,707 | 15,071 | 1.22× |
| jsonrpc | 6,675 | 7,730 | 6,609 | 7,608 | 1.14× |

Async is useful for concurrent unary throughput and thread use, but
performance work is **not finished**:

- At concurrency 1, fully async GetTask reaches **0.68× / 0.73× /
0.78×** fully synchronous throughput for gRPC / HTTP+JSON / JSON-RPC.
The median latency cost is approximately **47 / 73 / 84 microseconds**
on these immediately ready in-memory calls.
- At concurrency 64, GetTask client threads fall from **73 to 16** for
gRPC and **69 to 10** for HTTP+JSON/JSON-RPC; server threads fall from
**72–73 to 21–27**.
- Finite-stream async/sync server ratios are **1.00× / 0.99× / 0.99×**:
essentially parity. The gRPC client still uses a blocking reader thread
per stream, and the driver waits per operation; its process samples
**137 threads at concurrency 64** with either server mode. Native
callback-driven gRPC streaming and a callback-driven stream driver are
the clearest next targets, followed by scheduling/deadline-wakeup
overhead.
- Across all 49 broad workloads using the existing synchronous client,
the median server ratio is **0.79× at concurrency 1** and **1.09× at
concurrency 64**. This is a workload comparison, not a universal SDK
speedup.

The previous CI performance step took about **45 minutes** for three
broad passes and failed on **one async HTTP+JSON operation at
concurrency 64**; sustained CI measurements were consequently skipped.
The new local run did not reproduce that failure. Errors remain fatal
and invalidate ratios; a clean new CI run is still needed. The row
reduction removes roughly two-thirds of matrix execution, not
dependency-build time. Updated reports remain in the existing job
summary/artifact (`normal` and `normal/sustained`); no generated reports
are committed.

## Validation

- `./scripts/verify_changes.sh`: **passed (exit 0)**; **1,175 tests
passed, three skipped**, and all **188 source/test/example lint checks
passed**.
- **57 runner tests**, including single-pass defaults/reporting,
explicit repetition overrides, detailed operation errors, four
client/server combinations, and held subscriptions.
- Mandatory TCK: **215 passed, 14 skipped, 34 deselected**, zero
failures; checkout unchanged. Required performance smoke: **54 rows,
zero errors**.
- Exact CI formatting, mdBook, and actionlint: **passed**.
- Dependencies are unchanged. OSV scanning remains unverified because
its API returns HTTP 403.
- The existing TCK `HTTP_JSON-SVC-001` SHOULD Content-Type conflict
remains tracked in #328; the previous CI run still failed that check.

## Authorship and AI usage

- [ ] Contains substantive content written by a human
- [x] Contains substantive content generated by an AI agent

## Checklist

- [x] `./scripts/verify_changes.sh` passed locally
- [x] Docs updated
@MisterVVP MisterVVP added documentation Improvements or additions to documentation enhancement New feature or request AI agent AI agent contribution performance Performance improvement related tasks based on benchmark results. Performance tests changes. refactoring Constant technical improvements which are not necessarily related to any issue. labels Nov 18, 2026
## Changes

- Optimize async gRPC client streaming and HTTP/JSON + JSON-RPC request
handling.
- Improve async dispatcher scheduling, cancellation, streaming and
response lifecycle handling.
- Include the native HTTP ingress improvements already reviewed in #337
and #338.
- Add targeted tests and performance benchmarks; fix related protocol
compatibility issues.

## Verification

The identical head commit (`355db351f7e1161fdffad55e2f2baf33d8e5fe8a`)
passed the CI, TCK Conformance, CodeQL, Docs, Tutorials and Commit
messages workflows on #334: [CI
#1571](https://github.com/MisterVVP/a2a-cpp/actions/runs/44828943977).

**Policy note:** the diff includes the contributor TCK-gate change from
#338 (100% mandatory compliance → no regression), which should be
reviewed independently of performance improvements.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI agent AI agent contribution documentation Improvements or additions to documentation enhancement New feature or request performance Performance improvement related tasks based on benchmark results. Performance tests changes. refactoring Constant technical improvements which are not necessarily related to any issue.

Projects

None yet

1 participant