a2aproject / a2aproject/a2a-inspector

Message-kind responses with data parts are not rendered in chat

オープン 初心者向け
#151 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
490
フォーク
152
PR マージ指標
30日以内にマージされた PR はありません

説明

## Summary

The chat UI does not render agent responses when the response is a `message`-kind event containing `data` parts (structured JSON). The message is received by the inspector but nothing is displayed.

## Root Cause

In `frontend/src/script.ts`, the `case 'message'` handler inside the `socket.on('agent_response', ...)` listener only looks for `text` parts:

```typescript
const textPart = event.parts?.find(p => p.text);
if (textPart && textPart.text) {
// render text
}
```

If all parts are `data` parts (i.e. `kind: 'data'`, `data: {...}`), `textPart` is `undefined` and nothing is rendered — the message arrives but is silently dropped in the UI.

The `processPart` helper function already handles `data` parts correctly (renders as formatted `

` JSON), but it is only called in the `task`, `status-update`, and `artifact-update` cases — not in the `message` case.

## Steps to Reproduce

1. Connect the inspector to an A2A v1.0 agent that returns an **immediate Message response** (i.e. uses the synchronous workflow — enqueues a `Message` object rather than a `Task` with artifacts)
2. Send any message
3. The agent's response arrives (visible in the Debug Console) but the chat window remains empty

## Expected Behaviour

Structured data returned in a `message`-kind response should be rendered as formatted JSON in the chat window, consistent with how `data` parts are rendered in `artifact-update` responses.

## Proposed Fix

Replace the text-only lookup with a loop over all parts using the existing `processPart` helper:

```typescript
case 'message': {
const allContent: string[] = [];
event.parts?.forEach(p => {
const content = processPart(p);
if (content) allContent.push(content);
});
if (allContent.length > 0) {
const combinedContent = allContent.join('');
const messageHtml = `${event.kind} ${combinedContent}`;
appendMessage('agent', messageHtml, displayMessageId, true, validationErrors);
}
break;
}
```

This renders `text`, `data`, and `file` parts in message responses using the same logic already used for artifacts.

## Context

Discovered while validating a Google Maps A2A v1.0 agent (`a2a-sdk` based) that uses the immediate Message response pattern for synchronous skill calls.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The issue is in frontend/src/script.ts, in the socket.on('agent_response', ...) listener's case 'message' handler. Look at the existing processPart helper function to see how it handles data parts. The fix is to iterate over event.parts and call processPart for each, then combine and render the content. Test by connecting to an A2A v1.0 agent that returns a message with data parts and verifying the JSON appears in the chat UI.

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

評価

技術スタック
typescript
領域
frontend
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
75/100

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

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