Skip to content

feat(cluster): Introduce ServerCallContext to DatabaseTaskEventStream - #1399

Merged
Iwaniukooo11 merged 3 commits into
a2aproject:mainfrom
Iwaniukooo11:mateusziwaniuk/1374-add-server-context-to-event_stream
Oct 29, 2026
Merged

Iwaniukooo11 merged 3 commits into
a2aproject:mainfrom
Iwaniukooo11:mateusziwaniuk/1374-add-server-context-to-event_stream

Conversation

@Iwaniukooo11

Copy link
Copy Markdown
Member

Enabling ServerCallContext in DatabaseTaskEventStream methods

closes #1374

Change

This PR adds context to DatabaseTaskEventStream methods: subscribe, publish, destroy

To keep it backward-compatible, it doesen't change TaskEventStream abstract class.
Instead, DefaultRequestHandler and activetask EventConsumer check if methods of current TaskEventStream instance support context arg; otherwise, they warn.
Also, _seq_at_or_before_version method adds owner condition to follow TaskStore ownership behaviour

In long-term, the TaskEventStream methods should include context arg (breaking change, #1398)

Tests

Added 3 tests - Ensuring that warnings are logged when using TaskEventStream instance, that owner is accepted and that owner can't see other owner events

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/agent_execution/active_task.py 95.79% 95.84% 🟢 +0.05%
src/a2a/server/cluster/database_event_stream.py 92.86% 93.64% 🟢 +0.78%
src/a2a/server/request_handlers/default_request_handler_v2.py 88.68% 88.98% 🟢 +0.30%
Total 93.37% 93.40% 🟢 +0.03%

Generated by coverage-comment.yml

@Iwaniukooo11
Iwaniukooo11 force-pushed the mateusziwaniuk/1374-add-server-context-to-event_stream branch from 17d8fc3 to 244541d Compare October 29, 2026 11:16
@Iwaniukooo11
Iwaniukooo11 marked this pull request as ready for review October 29, 2026 11:21
@Iwaniukooo11
Iwaniukooo11 requested a review from a team as a code owner October 29, 2026 11:21
Comment thread src/a2a/server/cluster/database_event_stream.py Outdated
@Iwaniukooo11
Iwaniukooo11 merged commit 6168d59 into a2aproject:main Oct 29, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TaskEventStream methods don't receive ServerCallContext

2 participants