Repository navigation
fix(hooks): cache large WebFetch responses without argv limits - #771
Merged
addyosmani merged 2 commits intoNov 24, 2026
Merged
Conversation
addyosmani
approved these changes
Nov 24, 2026
addyosmani
left a comment
Owner
There was a problem hiding this comment.
praise: real failure, the right fix (stdin instead of argv), and a 2 MiB test with nasty characters. Thanks.
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.
Caching a 2 MiB WebFetch response fails with
Argument list too longbecause its body is passed tojq --arg. Pipe the body intojq -Rsand retain the existing cache fields and atomic replacement. Use Bash slicing for debug previews so large inputs do not trigger broken-pipe warnings on Linux (caught by the new regression in CI).The regression sends a 2 MiB response containing Unicode, quotes, backslashes and newlines through the real post hook with stubbed curl. It checks exact stored content, the validator, empty stderr and temporary-file cleanup. It reproduces the failure before the fix; all 35 cache assertions pass afterward.
Overlap check: #524 refactors helpers and #294 adds hook hardening; neither fixes response serialization. Their cache-hook changes each apply cleanly on top of this fix, and all 35 cache assertions pass with each applied (#524's additional 9 helper assertions also pass). Both PRs have pre-existing merge conflicts with main in unrelated files; this adds no cache-hook conflict. The companion fixes merge cleanly together.
Combined validation: 337 Node tests, all hook suites, repository validators and 150 deterministic eval checks pass. Tested locally on macOS; no network requests in hook tests. AI-assisted with Codex.