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

Open Beginner friendly
#159 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, json
Domain
cli

Research direction

The text formatting lives in internal/output/output.go: start with partText (around line 314), which marshals data parts with json.Marshal, and joinParts (around lines 388-397), which writes them beside the text. Reproduce by running a2a send against an agent that asks for permission, then check that text output shows only text parts while -o json stays unchanged. Done when text output no longer prints raw JSON blobs and the Resume line is visible, with a test covering a message that has both text and data parts.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
181
Forks
28
Avg merge
2d 11h
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from a2aproject/a2a-cli

All issues in a2aproject/a2a-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.