Skip to content

Compact default CLI and MCP output#2

Open
andrei-hasna wants to merge 1 commit into
mainfrom
fix/compact-cli-output
Open

Compact default CLI and MCP output#2
andrei-hasna wants to merge 1 commit into
mainfrom
fix/compact-cli-output

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

  • Make noisy CLI list/status/search-style output compact by default with capped human row counts, truncation, pagination hints, and --verbose/--json detail paths.
  • Add compact defaults and explicit full-detail affordances to MCP list/search/status tools (brief: false, verbose: true, include_raw: true, or detail/get tools).
  • Add coverage for compact defaults, full JSON/detail behavior, MCP context caps preserving target logs, and compact issue payloads.
  • Document compact output defaults and detail flags in the README.

Compatibility notes

  • Existing --json / --format json list paths continue to return full records where possible.
  • logs health now prints a compact human summary by default; use logs health --json for the full health object.
  • MCP status tools now return compact objects by default; use verbose: true for the full previous status payloads.

Before / after

Worst noisy path: logs list --limit 1 with a long log message plus large metadata.

Before:

2026-06-24T04:44:35.167Z  ERROR  checkout-automation-worker-with-long-name  checkout failure repeated during browser automation with a nested payload that includes route history request traces serialized context window retry diagnostics and verbose environment metadata repeated repeated repeated repeated repeated repeated repeated repeated repeated repeated end {"request_id":"req-example-123","payload":"metadata metadata metadata ...","nested":{"context":"browser route state retry diagnostics ..."}}

1 log(s)

After:

2026-06-24T04:44:35  ERROR  checkout-automa...  checkout failure repeated during browser automation with a nested payload that includes route history request traces serialized context w...  id=pr-example-log-1 trace=pr-example-trac...

showing 1 log(s).
Use --verbose for full messages/metadata or --json for full records.

Full machine-readable output remains available:

logs list --limit 1 --json

Adversarial review reconciliation

A read-only adversarial reviewer focused on CLI compatibility, output ergonomics, and token bloat found several issues. Reconciled in this branch:

  • MCP log_context_from_id capped results now preserve the requested target log; brief: false returns full context unless a limit is explicit.
  • CLI event/test-report list rows keep full IDs for events get <event_id> and test-reports get <report_id> workflows.
  • MCP include_raw: true now forces raw/full event rows for search/watch instead of requiring brief: false too.
  • MCP list_issues compact output truncates long issue messages.
  • Explicit logs list --format compact remains footerless/line-oriented.
  • MCP tool descriptions now advertise verbose and capped context parameters.

Validation

  • bun test src/cli/compact-output.test.ts src/mcp/index.test.ts
  • bun test
  • bun run lint
  • bun run build
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant