Client continuation messages can be stored with the agent role

オープン
#1,325 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Linux2010 がすでに取り組んでいます。

2026年11月14日 から。

  • #1326 @Linux2010 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java
領域
api, backend

調査の方向性

Start in DefaultRequestHandler.onMessageSend, where a client message reaches the executor with ROLE_AGENT and is written to task history for an existing task. The probe test DefaultRequestHandlerTest#probeClientAgentRoleIsAccepted reproduces the sequence and can be adapted to assert rejection. Done means a client message without ROLE_USER is refused before the executor runs or history changes, and the existing tests still pass. Confirm the rejection behaviour with maintainers first, since the issue proposes enforcing the protocol direction rather than citing an explicit MUST.

索引モデルが issue の本文から書いたものです。

説明

What happened?

A client can send an agent-authored message to DefaultRequestHandler.onMessageSend when continuing an existing task. The request succeeds, the executor receives ROLE_AGENT, and the same caller-supplied message is persisted in the task history with ROLE_AGENT. This can make client text appear agent-authored to history consumers.

Reproduced on a2a-java main 897835ef with an in-memory task store and the real default request handler:

  1. Save a task in TASK_STATE_INPUT_REQUIRED with a task ID and context ID.
  2. Call onMessageSend with a message containing those IDs, a text part, and Message.Role.ROLE_AGENT.
  3. Have the executor start work and complete the task.
  4. The call succeeds; RequestContext.getMessage().role() is ROLE_AGENT, and the persisted task history contains the caller's message ID with ROLE_AGENT.

A focused JUnit test using this sequence passed with mvn -o -pl server-common -am -Dtest=DefaultRequestHandlerTest#probeClientAgentRoleIsAccepted -Dsurefire.failIfNoSpecifiedTests=false test. This reproduction uses the default handler directly, not a network transport. It establishes the existing-task continuation case; it does not claim the new-task response has the same history behavior.

Expected behavior

Reject client messages without ROLE_USER as invalid input before invoking the agent or updating task history. The protocol describes ROLE_USER as client-to-server and ROLE_AGENT as server-to-client. This proposes enforcing that direction rather than asserting a separate explicit protocol MUST for rejection.

Related reports: a2aproject/a2a-go#564, a2aproject/a2a-js#819, a2aproject/a2a-rs#557 and a2aproject/a2a-dotnet#607.

主要言語
Java
スター
514
フォーク
200
平均マージ
1日 2時間
マージ済み PR(30日)
53

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

a2aproject/a2a-java のほかの issue

a2aproject/a2a-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。