Skip to content

Fix bounded CLI error JSON serialization - #2493

Merged
chubes4 merged 10 commits into
mainfrom
fix/error-json-2492-20260909
Sep 9, 2026
Merged

Fix bounded CLI error JSON serialization#2493
chubes4 merged 10 commits into
mainfrom
fix/error-json-2492-20260909

Conversation

@chubes4

@chubes4 chubes4 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #2492.

Bound CLI error serialization instead of expanding binary response bytes through nested causes. Preserve actionable error codes, summaries and artifact references while redacting sensitive values and representing binary values structurally. Traverse data properties safely and bound cycles, depth, entries, strings and aggregate payloads.

Separate the traversal budget from the complete pretty-printed UTF-8 failure-envelope budget. Preserve ordinary-object output contracts and safe handling of untrusted property names. Cover the measured long-message overflow through the actual CLI entrypoint.

Verification

Exact candidate: 90fd6de14438c7d1df1862d7931835a1c1aa77da.

  • Linux npm run check: all 314 commands passed.
  • npm exec -- tsx tests/error-json-serialization.test.ts: passed, including an independent parent rerun on the exact candidate.
  • Counterexample with an 8 KiB root message and 50 large fields: parseable retained output of 164593 UTF-8 bytes, below the 196608-byte limit.
  • npm run test:phpunit-result-paths: passed.
  • npm exec -- tsx tests/playground-phpunit-readonly-cache.integration.test.ts: passed, exercising an intentionally failed real PHPUnit recipe and verifying its retained files/test-results.json artifact.
  • All five GitHub checks passed: fast contracts, integration, browser, package check and workflow-lint.

AI Assistance

OpenAI GPT-5.6 Terra (openai/gpt-5.6-terra) via OpenCode implemented the repair and ran Linux verification. GPT-6 Astra (openai/gpt-6-astra) via OpenCode coordinated the work, independently reproduced the original and follow-up failures, reviewed security and output bounds, reran the exact candidate's regression, and finalized this PR under Chris Huber's direction.

@chubes4
chubes4 marked this pull request as ready for review September 9, 2026 11:47
@chubes4
chubes4 merged commit 1b1f2f4 into main Sep 9, 2026
5 checks passed
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.

Bound failure JSON serialization instead of expanding response bytes through nested causes

1 participant