Skip to content

feat(a2a): implement M12 A2A server#98

Merged
bug-ops merged 2 commits intomainfrom
feat/m12/a2a-server
Feb 8, 2026
Merged

feat(a2a): implement M12 A2A server#98
bug-ops merged 2 commits intomainfrom
feat/m12/a2a-server

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Feb 8, 2026

Summary

  • Add axum-based A2A HTTP server to zeph-a2a crate behind server feature flag
  • JSON-RPC 2.0 routing: message/send, tasks/get, tasks/cancel with spec-compliant error codes
  • In-memory TaskManager with full task lifecycle (create, get, update, cancel, artifacts, history)
  • SSE streaming endpoint (/a2a/stream) with events wrapped in JSON-RPC response envelope
  • Bearer token auth with constant-time comparison (subtle::ConstantTimeEq), per-IP rate limiting, 1 MiB body limit
  • Agent card served at /.well-known/agent-card.json (public, no auth)
  • A2aServerConfig with env var overrides for all fields
  • Graceful shutdown via tokio watch channel
  • Refactor Part to tagged enum with kind discriminator; rename TaskState::Pending to Submitted with kebab-case serde

Resolves #83, #84, #85
Epic: #82

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --features a2a -- -D warnings passes
  • 320 workspace tests pass (21 new server tests + tester-added edge cases)
  • Spec compliance verified against a2a-python reference implementation
  • Security audit: constant-time auth, body limits, rate limiting, no unsafe
  • Code review: approved with no blocking issues

…ement, and SSE streaming

Add axum-based HTTP server to zeph-a2a crate behind feature-gated
server module. Implements core A2A protocol server-side operations:
JSON-RPC 2.0 dispatch for message/send, tasks/get, tasks/cancel;
in-memory TaskManager with full lifecycle; SSE streaming with
JSON-RPC response envelope; bearer token auth with constant-time
comparison (subtle); per-IP rate limiting; 1 MiB body size limit.

Refactor Part from flat struct to tagged enum with kind discriminator
and rename TaskState::Pending to Submitted with explicit per-variant
serde renames for spec-compliant kebab-case wire format.

Resolves #83, #84, #85
@github-actions github-actions bot added enhancement New feature or request size/XL Extra large PR (500+ lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates config Configuration file changes and removed enhancement New feature or request labels Feb 8, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 89.00929% with 142 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/main.rs 0.00% 54 Missing ⚠️
crates/zeph-a2a/src/server/mod.rs 89.28% 51 Missing ⚠️
crates/zeph-a2a/src/server/handlers.rs 94.39% 12 Missing ⚠️
crates/zeph-core/src/config.rs 72.72% 12 Missing ⚠️
crates/zeph-a2a/src/types.rs 88.33% 7 Missing ⚠️
crates/zeph-a2a/src/server/state.rs 98.31% 4 Missing ⚠️
crates/zeph-a2a/src/server/router.rs 99.02% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   78.93%   81.05%   +2.11%     
==========================================
  Files          28       32       +4     
  Lines        4881     6161    +1280     
==========================================
+ Hits         3853     4994    +1141     
- Misses       1028     1167     +139     
Files with missing lines Coverage Δ
crates/zeph-a2a/src/client.rs 84.25% <100.00%> (+0.13%) ⬆️
crates/zeph-a2a/src/error.rs 97.05% <ø> (ø)
crates/zeph-a2a/src/server/router.rs 99.02% <99.02%> (ø)
crates/zeph-a2a/src/server/state.rs 98.31% <98.31%> (ø)
crates/zeph-a2a/src/types.rs 97.08% <88.33%> (-2.92%) ⬇️
crates/zeph-a2a/src/server/handlers.rs 94.39% <94.39%> (ø)
crates/zeph-core/src/config.rs 93.73% <72.72%> (-2.73%) ⬇️
crates/zeph-a2a/src/server/mod.rs 89.28% <89.28%> (ø)
src/main.rs 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…A server

- Bump workspace version 0.6.0 -> 0.7.0
- Add A2A Server section to README with endpoints and env vars
- Add A2A environment variables to docker-compose.yml and docker-compose.dev.yml
- Expose A2A port 8080 in Docker Compose services
- Add zeph-a2a Cargo.toml to Dockerfile.dev dependency cache layer
- Update CHANGELOG with 0.7.0 release date
@github-actions github-actions bot added the enhancement New feature or request label Feb 8, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 8, 2026 19:37
@bug-ops bug-ops merged commit 3fbb1e8 into main Feb 8, 2026
17 checks passed
@bug-ops bug-ops deleted the feat/m12/a2a-server branch February 8, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

M12/Phase 1: A2A HTTP server and JSON-RPC routing

2 participants