[Bug]: TaskEventStream methods don't receive ServerCallContext
维护者通常 2 天内回复
@rohityan 已经在做这个了。
开始于 2026年10月23日。
评估
这个 Issue 还没有评估数据。
描述
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
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 518
- 平均合并
- 3 天 7 小时
- 30 天内合并 PR
- 38
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
a2aproject/a2a-python 的其他 Issue
-
[Bug]: `A2A-Version` validation ignores minor versions and the query parameter可能已有人在做 @rohityan 于 61 天前认领。 未关闭component: server status:awaiting response
难度 2/5 1-3 小时 新手友好度 75/100
a2aproject/a2a-python#1204 · 3 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Bug]: REST task/request id sanitization可能已有人在做 @Linux2010 于 120 天前认领。 未关闭maintainers-only
难度 2/5 1-3 小时 新手友好度 65/100
a2aproject/a2a-python#805 · 1 条评论 ·
维护者通常 2 天内回复
-
v0.3 REST GetTask returns 500 for a non-integer historyLength可能已有人在做 @rohityan 今天认领。 未关闭
a2aproject/a2a-python#1381 · 已指派 2 人 ·
维护者通常 2 天内回复
-
v0.3 pushNotificationConfig/get by task id fails with Validation failed可能已有人在做 @rohityan 今天认领。 未关闭
a2aproject/a2a-python#1379 · 已指派 2 人 ·
维护者通常 2 天内回复
-
[Bug]: REST tenant routes are mounted before `path_prefix`, so tenant requests from the SDK client get 404可能已有人在做 @rohityan 今天认领。 未关闭
a2aproject/a2a-python#1376 · 已指派 2 人 ·
维护者通常 2 天内回复
查看 a2aproject/a2a-python 的全部 Issue
相似的 Issue
-
request-theme
难度 1/5 1 小时以内 新手友好度 66/100
LizardByte/ThemerrDB#9575 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 62/100
acl-org/acl-anthology#10599 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
zilliztech/memsearch#818 ·
维护者通常 1 天内回复
-
[FAQ] Commit ID for Projects可能已有人在做 @github-actions 今天认领。 未关闭faq-proposal
难度 1/5 1 小时以内 新手友好度 84/100
DataTalksClub/faq#503 · 1 条评论 ·
维护者通常 2 天内回复
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-free可能已有人在做 @Aaqibhafeezkhan 今天认领。 未关闭beginner documentation good first issue
难度 2/5 1-3 小时 新手友好度 75/100
BistaDinesh03/critique#164 · 1 条评论 ·
维护者通常 1 天内回复