Skip to content

fix(cli): fold away serialized structuredContent of any JSON type - #405

Merged
jancurn merged 2 commits into
mainfrom
claude/adoring-noether-2vdq9i
Sep 16, 2026
Merged

jancurn merged 2 commits into
mainfrom
claude/adoring-noether-2vdq9i

Conversation

@jancurn

@jancurn jancurn commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Follow-up nits on the --json hint from #386. The duplicate-text filter only ran when structuredContent was a plain object, so a server returning an array or a primitive next to its own serialization had the data printed once as text and then advertised again by the new hint — pointing at --json for something already on screen.

  • Compare the canonical JSON whatever the type, so the serialized block is folded away for arrays and primitives too
  • Shorten the hint to the house one-sentence form: To see the `structuredContent` field, re-run with --json
  • Cover the non-object dedup with a parametrized test

Validated on this branch: pnpm run lint (0 errors), build, test:unit (1174 passed), check:reference, and e2e basic/human-output, output-invariants, help, max-chars green on both the legacy and modern protocol servers.

Refs #346, #386

🤖 Generated with Claude Code

https://claude.ai/code/session_01B7XSZpKcSsCGm6whjo552e

The duplicate-text filter only ran when structuredContent was a plain
object, so a server returning an array or a primitive alongside its own
serialization had the data printed once as text and then advertised
again by the --json hint added in #386. Compare the canonical JSON
instead, whatever the type.

Also shortens the hint to the house one-sentence form.

Refs #346, #386

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7XSZpKcSsCGm6whjo552e
Comment thread src/cli/output.ts Outdated
Review feedback on #405.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7XSZpKcSsCGm6whjo552e
@jancurn
jancurn merged commit 165fe0f into main Sep 16, 2026
7 checks passed
@jancurn
jancurn deleted the claude/adoring-noether-2vdq9i branch September 16, 2026 11:01
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.

3 participants