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

Đang mở Phù hợp với người mới
#159 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 2 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, json
Lĩnh vực
cli

Hướng nghiên cứu

Phần định dạng văn bản nằm trong internal/output/output.go: bắt đầu từ partText (khoảng dòng 314), hàm này tuần tự hóa các phần dữ liệu bằng json.Marshal, và joinParts (khoảng dòng 388-397), hàm này ghi chúng cạnh phần văn bản. Để tái hiện, chạy a2a send với một agent yêu cầu quyền, rồi kiểm tra rằng đầu ra văn bản chỉ hiển thị các phần văn bản còn -o json giữ nguyên. Hoàn thành khi đầu ra văn bản không còn in các khối JSON thô và dòng Resume hiển thị, kèm một bài kiểm thử cho thông điệp có cả phần văn bản lẫn phần dữ liệu.

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

Mô tả

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.

Ngôn ngữ chính
Go
Star
181
Fork
28
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
22

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-cli

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

Issue tương tự

Thêm issue về Go

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.