Proposal: Introduce a plugin framework
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- java
调研方向
Read the SDK architecture and existing extension points, then compare them with the cross-cutting hooks described in the issue. The issue asks whether a plugin framework fits the roadmap and architecture, so first establish the maintainers’ direction before proposing an implementation. Done would require a settled design and scope; no Java files or tests are named.
由索引模型根据 Issue 内容生成。
描述
Context
We (A2A Go, Python and JS SDK maintainers) have recently introduced a plugin framework across all 3 SDKs to give users a unified way to build cross-cutting features (such as OpenTelemetry tracing/metrics, authentication, auditing, retries, caching, and header/context propagation).
Sharing this here in case it makes sense to adopt a similar model in this SDK.
Motivation
Cross-cutting integrations often need to hook into several parts of the SDK at once, not just RPC calls:
- Incoming server calls (unary and streaming)
- Outgoing client calls (unary and streaming)
- Agent execution (before/after execution, around execution for context scoping, emitted events)
- Task store writes (observing task creation and state transitions)
- Push notification deliveries (injecting headers, skipping deliveries, observing status/duration/errors)
Simple before/after call interceptors alone are not enough for cases like retries, caching, timeouts, or ending a tracing span when a stream finishes—so having a way to wrap calls/components alongside (or backing) lifecycle hooks has been key.
Key Ideas (Shared Across Go / Python / JS)
- Single registration point for a plugin that can hook into multiple SDK components.
- Selective hooks: plugins only implement the hooks they need; unused hooks have no overhead.
- Wrapping + lifecycle hooks: support both wrapping execution/calls (for spans, retries, short-circuiting, stream end detection) and simple
before/afterhooks. - Deterministic ordering:
beforehooks run in registration order;afterhooks run in reverse order. - Backwards-compatible: existing interceptors/extension points continue to work.
Reference Implementations
Go (a2a-go) — wrap-based core interfaces + hook-based helper layer:
- Design issue: https://github.com/a2aproject/a2a-go/issues/538
- Core plugin interface: https://github.com/a2aproject/a2a-go/pull/572
- Hook helpers (
a2aplugin): https://github.com/a2aproject/a2a-go/pull/581 - Examples built on it: OAuth client plugin (https://github.com/a2aproject/a2a-go/pull/570), OpenTelemetry tracing plugin (https://github.com/a2aproject/a2a-go/pull/616)
Python (a2a-python) — protocol/interface-based plugins + call wrapping:
- Core plugin framework: https://github.com/a2aproject/a2a-python/pull/1352
wrap_client_call/wrap_server_callhooks: https://github.com/a2aproject/a2a-python/pull/1491- OpenTelemetry client plugin (WIP): https://github.com/a2aproject/a2a-python/pull/1504
JS/TS (a2a-js) — hook-based plugin object wired across server, client, execution, task store, and push:
- Core types: https://github.com/a2aproject/a2a-js/pull/826
- Hook integrations: server (https://github.com/a2aproject/a2a-js/pull/835), client (https://github.com/a2aproject/a2a-js/pull/838), execution (https://github.com/a2aproject/a2a-js/pull/839), task store (https://github.com/a2aproject/a2a-js/pull/840), push (https://github.com/a2aproject/a2a-js/pull/841)
- Tests, samples, and docs: https://github.com/a2aproject/a2a-js/pull/846, https://github.com/a2aproject/a2a-js/pull/847, https://github.com/a2aproject/a2a-js/pull/848
Does a plugin framework like this fit the roadmap and architecture of this SDK?
- 主要语言
- Java
- 星标
- 516
- 派生
- 205
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 78
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
a2aproject/a2a-java 的其他 Issue
-
HTTP+JSON CancelTask returns 409 Conflict instead of 400 Bad Request for TaskNotCancelableError可能重新可做 @ravismash 于 21 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
a2aproject/a2a-java#1298 · 5 条评论 ·
维护者通常 1 天内回复
-
fix: handle blank push notification config id consistently across transports可能重新可做 @prachisinghal-1 于 36 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
a2aproject/a2a-java#1012 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
a2aproject/a2a-java#464 · 1 条评论 ·
维护者通常 1 天内回复
-
Create a sample that demonstrates how to use a shared contextId across multiple tasks可能重新可做 @tanish111 于 402 天前认领,目前没有进行中的 PR。 未关闭sample
难度 2/5 1-3 小时 新手友好度 70/100
a2aproject/a2a-java#375 · 5 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 18/100
a2aproject/a2a-java#1351 ·
维护者通常 1 天内回复
查看 a2aproject/a2a-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
avaje/avaje-metrics#139 ·
-
documentation good first issue help wanted
难度 1/5 1 小时以内 新手友好度 90/100
-
Attachment upload accepts a file part with no file chosen and stores an empty comp_attachment可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
eclipse-sw360/sw360#4849 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
exoego/keycloak-fuhito#888 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
liquid-java/liquidjava#562 ·
维护者通常 1 天内回复