Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[Bug]: TaskEventStream methods don't receive ServerCallContext

Offen
#1,374 0 Kommentare 0 Reaktionen 2 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@rohityan arbeitet bereits daran.

Seit 23.10.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

What happened?

Version: a2a-sdk 1.2.1

Problem

TaskEventStream (a2a/server/cluster/event_stream.py L17–32) is keyed only by task_id:

async def publish(self, task_id: str, event: VersionedEvent) -> None: ...
def subscribe(self, task_id: str, *, after: TaskVersion) -> AsyncGenerator[VersionedEvent, None]: ...
async def destroy(self, task_id: str) -> None: ...

TaskStore, VersionedTaskStore and PushNotificationConfigStore.{set,get,delete}_info all take context: ServerCallContext. TaskEventStream and PushNotificationConfigStore.get_info_for_dispatch don't.

Context-derived identity is already central to the SDK — OwnerResolver = Callable[[ServerCallContext], str], and DatabaseTaskStore scopes every query by owner = self.owner_resolver(context). TaskEventStream can't participate.

Impact

DefaultRequestHandlerV2 holds one event_stream from construction (L143) and calls publish (L304) / subscribe (L571) with no caller information, so an implementation is permanently bound to its startup resources. That rules out selecting a backing resource per caller, refreshing credentials at a request boundary, propagating auth downstream, or request-scoped tracing — all of which TaskStore supports today.

Related: DatabaseTaskEventStream filters only on task_id/seq, never on the owner column it writes. Authorization is enforced upstream (_versioned_store.get(task_id, context) precedes subscribe), so the default composition is safe — but the stream can't check independently.

Proposed change

Add context: ServerCallContext to the three methods, optional for source compatibility:

async def publish(self, task_id: str, event: VersionedEvent, context: ServerCallContext | None = None) -> None: ...
def subscribe(self, task_id: str, *, after: TaskVersion, context: ServerCallContext | None = None) -> ...: ...
async def destroy(self, task_id: str, context: ServerCallContext | None = None) -> None: ...

The handler already holds the context at both call sites.

get_info_for_dispatch has the same gap — dispatch runs after the request completes, so it needs a stored context, not a live one.

Relevant log output

Code of Conduct
  • I agree to follow this project's Code of Conduct
Vorherrschende Sprache
Python
Sterne
2.2k
Forks
518
Ø Merge
3 T. 12 Std.
Gemergte PRs (30 T.)
39

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus a2aproject/a2a-python

Alle Issues in a2aproject/a2a-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.