a2aproject / a2aproject/a2a-dotnet

Define consistent tenant-field handling for JSON-RPC and HTTP+JSON

未关闭
#485 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
262
派生
64
平均合并
5 天 2 小时
30 天内合并 PR
31

描述

## Context

Follow-up to #418; related to #368.

The agreed design direction from the #418 review discussion is that explicit tenant parameters are for gRPC. JSON-RPC and HTTP+JSON select the tenant-specific agent through its URL, with routing owned by the host application. This records the SDK design direction, rather than asserting that all published specification text already reflects it.

#418 remains scoped to flattening push notification configuration. It clears the body tenant for standalone REST push-config creation and corrects the REST documentation, but does not establish a binding-wide tenant-field policy.

## Remaining inconsistency

- Other body-bearing REST operations, including SendMessage and streaming SendMessage, forward request tenant fields unchanged.
- JSON-RPC also forwards tenant fields in request parameters.
- Shared request models expose Tenant, and HTTP clients can serialize it.
- #368 proposes populating request Tenant from REST routes and describes explicit JSON-RPC tenant parameters; that proposal needs reconciliation with the agreed URL-based approach.

## Scope

- Define one consistent policy for explicit tenant fields in both HTTP bindings: omission on outgoing requests and rejection or ignoring on incoming requests. Decide the compatibility behavior explicitly; do not silently change routing context.
- Ensure body/params tenant fields cannot override the agent identity selected by the host URL/routing.
- Cover unary and streaming operations, standalone push-config operations, and embedded push configurations.
- Retain explicit tenant parameters for gRPC and avoid removing shared model fields required by that binding.
- Review v0.3 compatibility adapters where they intersect with the policy.
- Document host-configured tenant-specific agent URLs without prescribing a fixed URL layout.
- Reconcile the overlapping proposal in #368.

## Acceptance criteria

- JSON-RPC and HTTP+JSON have a documented, consistent tenant-field policy.
- Serialization and server-dispatch regression coverage includes supplied, omitted, and conflicting tenant values and unary/streaming paths.
- URL-selected agent identity is not overridden by request fields.
- gRPC's explicit tenant representation remains supported.
- Documentation describes actual behavior without claiming that every REST request Tenant field is already null.

贡献指南

打开贡献指南

调研方向

Review the shared request models exposing the Tenant field, the JSON-RPC parameter handling, and HTTP bindings for operations like SendMessage. Examine the routing logic to understand how the agent identity is selected from the URL. The goal is to define a policy that prevents request fields from overriding URL-based routing, while maintaining gRPC support. Check existing tests for serialization and dispatch to ensure coverage.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
api, backend
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。