Fix bounded CLI error JSON serialization - #2493
Merged
Merged
Conversation
chubes4
marked this pull request as ready for review
September 9, 2026 11:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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.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 retainedfiles/test-results.jsonartifact.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.