Proposal: Introduce a plugin framework
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java
- Bereich
- backend-api-design, developer-experience
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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?
- Vorherrschende Sprache
- Java
- Sterne
- 516
- Forks
- 205
- Ø Merge
- 2 T. 22 Std.
- Gemergte PRs (30 T.)
- 78
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus a2aproject/a2a-java
-
HTTP+JSON CancelTask returns 409 Conflict instead of 400 Bad Request for TaskNotCancelableErrorEvtl. wieder frei @ravismash hat das vor 21 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
a2aproject/a2a-java#1298 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
fix: handle blank push notification config id consistently across transportsEvtl. wieder frei @prachisinghal-1 hat das vor 36 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
a2aproject/a2a-java#1012 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
a2aproject/a2a-java#464 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Create a sample that demonstrates how to use a shared contextId across multiple tasksEvtl. wieder frei @tanish111 hat das vor 403 Tagen übernommen, und es ist kein Pull Request offen. Offensample
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
a2aproject/a2a-java#375 · 5 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
a2aproject/a2a-java#1351 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in a2aproject/a2a-java
Ähnliche Issues
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
apache/maven-fluido-skin#387 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 91/100
simplex-chat/simplex-chat#8372 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good-first-issue samples
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
avaje/avaje-metrics#139 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 17 Tagen