Skip to content

Drop TOON output support - #33

Open
quinnmil wants to merge 4 commits into
mainfrom
28-drop-toon-support
Open

quinnmil wants to merge 4 commits into
mainfrom
28-drop-toon-support

Conversation

@quinnmil

Copy link
Copy Markdown
Contributor

Closes #28

Summary

Removes --toon, the outputTOON encoder, and the toon-format/toon-go dependency. --json is now the CLI's one structured output format. Piped output now auto-enables --json (instead of TOON), preserving the original "zero-config for scripts/agents" goal without the format itself.

Why

TOON was added experimentally to save tokens for LLM consumption. An audit found real problems: scout traces show produced invalid TOON when piped (a nested-list encoding bug in the upstream toon-go library, not this codebase), and every other command's --toon output disagreed with --json on field names and which fields appeared at all (the library reads a struct tag this codebase never defined, so it silently fell back to raw Go field names). The TOON spec itself is still at Thoughtworks' "Assess" stage, and the Go port has no tagged release. Scout's MCP server already covers structured agent access better than a CLI output format can. Full reasoning is on the issue.

Changes

  • cmd/root.go: removed the flag, the encoder, the import, and the dependency-driven branch in structuredOutput. The piped-output auto-detect now sets jsonOutput instead of toonOutput.
  • cmd/usage.go, cmd/jobs.go: dropped && !toonOutput progress-bar guards (now just !jsonOutput) and --toon mentions in help text.
  • go.mod/go.sum: removed via go mod tidy, no transitive deps affected.
  • README.md: LLM/Agent Usage section rewritten around JSON-when-piped; --toon row removed from the flags table.
  • No tests referenced TOON, so none needed removal.

Verified

  • scout apps list --json unchanged.
  • scout apps list | head now emits JSON with no flag.
  • scout apps list --toon → cobra "unknown flag" error, confirming full removal.
  • No --toon mention in any --help output.
  • Grep for "toon" across the repo returns only the frozen historical v0.3.0 changelog entry (correctly untouched) and this PR's own changelog fragment.
  • scout traces show <id> | jq (previously broken under TOON) now parses cleanly as JSON, ending in a trailing newline.

Test plan

  • gofmt -l cmd internal (clean, aside from a pre-existing unrelated file)
  • go vet ./...
  • go build
  • go test -race ./...
  • golangci-lint run ./... (0 issues)
  • Live smoke tests above

🤖 Generated with Claude Code

https://claude.ai/code/session_01BK3fzED9ksTWsvoPfsEwpS

@quinnmil quinnmil linked an issue Sep 10, 2026 that may be closed by this pull request
quinnmil and others added 4 commits September 11, 2026 10:23
Every open PR editing CHANGELOG.md's `## Pending` section directly meant
any two concurrent PRs collided on the same lines, and each merge forced
the next PR to redo the conflict resolution. Add changelog.d/, where each
PR drops a new file instead of editing the shared section, so concurrent
PRs can never conflict on this axis. scripts/assemble_changelog.py folds
the fragments into a versioned CHANGELOG.md section at release time.

See changelog.d/README.md for the fragment format and
.claude/commands/release.md for the updated release process (not
committed here — .claude/ isn't tracked in this repo yet).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BK3fzED9ksTWsvoPfsEwpS
Drop the --toon flag, the outputTOON encoder, and the
github.com/toon-format/toon-go dependency. --json is now the CLI's
only structured output format.

Piped output previously auto-enabled TOON; it now auto-enables JSON,
preserving the zero-config-for-scripts behavior without the format.
Progress-bar suppression is likewise driven by jsonOutput alone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BK3fzED9ksTWsvoPfsEwpS
Rewrite the LLM / Agent Usage section around --json, drop the --toon
row from the Global Flags table, and note that --json auto-enables
when piped.

Closes #28

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BK3fzED9ksTWsvoPfsEwpS
Drop changelog.d/ and the assembly script. Move this PR's changelog
entry into CHANGELOG.md's Pending section directly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BK3fzED9ksTWsvoPfsEwpS
@quinnmil
quinnmil force-pushed the 28-drop-toon-support branch from d09a961 to 37ee151 Compare September 11, 2026 17:26

@mitchh456 mitchh456 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete removal — no surviving TOON references outside the frozen v0.3.0 changelog entry, and structured-output semantics are unchanged apart from the intended TOON→JSON swap.

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.

Drop TOON output support (--toon flag and toon-go dependency)

2 participants