Repository navigation
refactor(server)!: switch async execution to Boost.Asio coroutines - #319
Merged
Merged
Conversation
Await CoroutineAgentExecutor directly on an application-owned Asio context. Remove the callback executor, adapter and custom dispatcher worker queue; migrate fixtures, SUT, examples, benchmarks and package consumers. Preserve terminal arbitration, cancellation, pending-frame bounds and shared sync routing. Handle modern gRPC deadline APIs in native lifecycle tests. Fix HTTP reactor teardown and off-thread cleanup races found by validation.
Install checksum-pinned simdjson 4.6.11 with Boost for the Clang 19 lint profile. This matches local validation and avoids Ubuntu 24.04's invalid simdjson 3.0.1 CRTP lookup without changing the SDK minimum dependency. Defer Windows GoogleTest enumeration until test time, after linking and app-local DLL deployment complete. Give JSON-RPC integration discovery 30 seconds without changing test execution timeouts.
Owner
Author
|
@codex review this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switch the async server execution API from completion callbacks to Boost.Asio coroutines.
AsyncDispatchernow awaitsCoroutineAgentExecutoroperations directly, including shared validation, interception, authorization, dispatch and response projection. This replaces the callback engine rather than wrapping it.Targets feat/async-server, continuing #268 / #318.
AsyncAgentExecutor,AsioAgentExecutor, and the dispatcher's custom worker queue. All eight executor unary operations return typedboost::asio::awaitable<core::Result<T>>; agent-card providers remain in the dispatcher.max_pendingalso bounds frames retained after logical cancellation. The completion sink at the gRPC transport boundary remains required by gRPC's callback reactor API.a2a::asio, enabled byA2A_ENABLE_ASIO=ON; there is no callback execution fallback.API migration: derive from
CoroutineAgentExecutor, useco_return/co_await, constructAsyncDispatcher(application, scheduler, options), and linka2a::asio. Replaceworker_countwith a caller-owned execution context, and drain it during shutdown. Coroutine cancellation cannot forcibly interrupt uncooperative backend I/O. Blocking security/store APIs still need bounded workers; coroutine streaming and native async HTTP/JSON-RPC listeners remain follow-up work.Validation
A2A_VERIFY_POSTGRES=1 A2A_VERIFY_BUILD_DIR=build ./scripts/verify_changes.sh: 916 registered tests, no failures, two expected TLS-without-SUT skips; complete source/test lint passes. Asio enabled with Boost 1.92.0../scripts/run_clang_tidy.sh build: exit 0. Changed test translation units also pass Clang 18 / GoogleTest 1.14 complexity checks.mdbook build book, workflow YAML parsing and changed shell-script syntax checks pass. Python dependencypip-auditreports no known vulnerabilities. The Boost archive checksum/license were verified. OSV Scanner does not support this vcpkg manifest, so this is not a complete automated C++ dependency advisory audit.Controlled native-gRPC evidence (RelWithDebInfo, GCC 15, gRPC 1.51.1, Boost 1.92.0; backend held for 10 ms):
The coroutine process stayed at 13 threads for both request counts; the synchronous process rose from 11 to 42 / 138 threads. This demonstrates bounded application-thread use for a controlled asynchronous backend, not general database throughput. Immediate-dispatch Google Benchmark samples were also recorded; the previous callback-adapter timing is no longer evidence for this replacement design.
Authorship and AI usage
Checklist
./scripts/verify_changes.shpassed locally