Proposal: Introduce a plugin framework

Đang mở
#1,364 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
java

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:

  1. Incoming server calls (unary and streaming)
  2. Outgoing client calls (unary and streaming)
  3. Agent execution (before/after execution, around execution for context scoping, emitted events)
  4. Task store writes (observing task creation and state transitions)
  5. 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/after hooks.
  • Deterministic ordering: before hooks run in registration order; after hooks 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:

Python (a2a-python) — protocol/interface-based plugins + call wrapping:

JS/TS (a2a-js) — hook-based plugin object wired across server, client, execution, task store, and push:

Does a plugin framework like this fit the roadmap and architecture of this SDK?

Ngôn ngữ chính
Java
Star
516
Fork
205
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
78

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của a2aproject/a2a-java

Tất cả issue của a2aproject/a2a-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.