agents-cli icon indicating copy to clipboard operation
agents-cli copied to clipboard

Startup and version notices corrupt agents-cli info --json stdout

Open benagentai93-dot opened this issue 3 months ago • 2 comments

Baseline

Reproduced from v1.3.1 at 5a306f8956cb1eeae69f9709de0e4d61b44e11e7.

Reproduction

Use a valid project manifest that triggers one or more update, skills-version, legacy-config, or CLI/project-version notices, then run:

agents-cli info --json > info.json
python -m json.tool info.json

Actual behavior

Notices are written to stdout before or after the JSON payload, so info.json is not directly parseable by a JSON consumer even though the command explicitly requested machine-readable output.

Expected behavior

Stdout should contain only the command payload. Update/version/skills/legacy warnings belong on stderr, preserving their visibility without corrupting JSON.

Minimal fix

Use Click's err=True for warning echoes and configure the shared Rich update console with Console(stderr=True). No output-format abstraction is required.

Reference implementation: https://github.com/benagentai93-dot/agents-cli/commit/0510574771022bc9bb5d12a491a5905449eccca7

Test evidence

A runnable regression triggers all four notice families together, parses result.stdout with json.loads, and verifies each notice remains present on stderr.

Fork verification on Python 3.11/3.13:

  • focused Batch 1 suite: 17 passed
  • full root suite: 19 passed
  • lint, type check, build, and installed-wheel smoke: passed

benagentai93-dot avatar Aug 13 '26 09:08 benagentai93-dot

Thanks for reporting! We will look into this and get back to you.

asrujana-44 avatar Aug 31 '26 18:08 asrujana-44

Fixed in https://github.com/google/agents-cli/releases/tag/v1.6.1

pvlsirotkin avatar Sep 16 '26 14:09 pvlsirotkin