feat(server): add versioned task store and event stream interfaces - #1244
Open
mykytanetipa wants to merge 1 commit into
Open
mykytanetipa wants to merge 1 commit into
mykytanetipa wants to merge 1 commit into
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/models.py | 97.83% | 90.16% | 🔴 -7.66% |
| src/a2a/server/tasks/database_task_store.py | 91.19% | 92.45% | 🟢 +1.26% |
| src/a2a/server/cluster/database_event_stream.py (new) | — | 93.88% | — |
| src/a2a/server/cluster/database_task_store.py (new) | — | 95.12% | — |
| src/a2a/server/cluster/event_stream.py (new) | — | 100.00% | — |
| src/a2a/server/cluster/task_store.py (new) | — | 100.00% | — |
| src/a2a/server/cluster/version.py (new) | — | 100.00% | — |
| Total | 93.06% | 93.12% | 🟢 +0.06% |
Generated by coverage-comment.yml
mykytanetipa
added this pull request to stack #1246
September 17, 2026 08:45
This was referenced Sep 17, 2026
mykytanetipa
force-pushed
the
multiserver/cluster-schemas
branch
from
September 17, 2026 09:57
56d51d2 to
7f4a2b0
Compare
…ing blocks Introduces the a2a.server.cluster package: the extension points for running the A2A server as multiple replicas behind a load balancer with no task affinity. The package is inert at this commit -- nothing in the runtime imports it yet -- but it also adds a `version` column to the shared tasks schema that database-backed deployments must provision (see the schema bullet). * Optimistic concurrency: TaskVersion, VersionedTaskStore (compare-and-set) whose `get` returns a `StoredTask` (task + version), with ConcurrentTaskModificationError and a LegacyTaskStoreAdapter that runs an existing TaskStore under the versioned interface (last-writer-wins). * Versioned store: VersionedDatabaseTaskStore (CAS on a version column) with a configurable bounded retry (max_attempts / retry_delay_s) for transient DB contention. * Cross-replica event stream: TaskEventStream / VersionedEvent and DatabaseTaskEventStream tailing a transactional task_events outbox. * Schema: nullable `version` column on TaskMixin plus the `task_events` outbox table. Their VALUES are inert for the non-versioned stores (version stays NULL, task_events empty), but DatabaseTaskStore selects and writes every mapped column, so the `version` column must exist in the database. Any database-backed deployment must run `a2a-db` after upgrading -- versioned or not; create_table=True (dev/tests) picks it up automatically.
mykytanetipa
force-pushed
the
multiserver/cluster-schemas
branch
from
September 17, 2026 10:36
7f4a2b0 to
52df455
Compare
mykytanetipa
marked this pull request as ready for review
September 17, 2026 10:51
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.
Adds a2a.server.cluster, the building blocks for running the A2A server as several replicas, with no need to route a task's requests back to the replica that started it. This PR is purely additive nothing uses the new structures yet.
Key changes:
Tested:
Design discussion: #1224