bug: text output prints data parts as raw JSON next to the message text

未关闭 适合新手
#159 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, json
领域
cli

调研方向

文本格式化逻辑位于 internal/output/output.go。先看 partText(约第 314 行),它用 json.Marshal 序列化数据部分;再看 joinParts(约第 388–397 行),它把这些数据部分写在文本旁边。复现方法是:对一个会请求权限的 agent 运行 a2a send,然后检查文本输出是否只显示文本部分,同时 -o json 保持不变。完成标准是:文本输出不再打印原始 JSON 块,并且 Resume 行可见;同时需要一个测试,覆盖同时包含文本部分和数据部分的消息。

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

描述

In text output, a2a send and a2a task get print the data parts of a message as raw JSON on the same line as its text. For an approval question that is the tool call and the whole answer schema, often more than 600 characters. The Resume: line ends up below it.

Repro (against a2a-serve)

a2a send -a "$URL" "Write the output of 'uname -sr' to system.txt."

Actual

Status:   input-required (...)
  Permission required: uname -sr > system.txt.
Reply with one of: once, reject. {"toolCall":{"id":"9HTPYMSYBUAjGuxm","input":{"command":"uname -sr \u003e system.txt"},"kind":"execute",...}} {"properties":{"option":{"oneOf":[{"const":"once","title":"Allow once"},...

Every Running … line in the task history also ends with a {"toolCall":…} blob. With -o json, the text and data parts are separate and clean.

Expected

Text output shows the text parts. Data parts appear in -o json, or as a short marker such as [data].

Cause

internal/output/output.go: partText (about line 314) marshals data parts with json.Marshal, and joinParts (about lines 388-397) writes them next to the text.

This was seen on every approval in 4 lanes. Related server-side issue: a2aproject/a2a-serve#167.

Found by user simulation (tools/sim) at 1b67edf.

主要语言
Go
星标
181
派生
28
平均合并
2 天 11 小时
30 天内合并 PR
22

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

a2aproject/a2a-cli 的其他 Issue

查看 a2aproject/a2a-cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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