Skip to content

fix(cli): skip large JSON inspection outside debug mode - #1782

Open
suntaoathome wants to merge 1 commit into
slopus:mainfrom
suntaoathome:fix/debug-large-json-production
Open

suntaoathome wants to merge 1 commit into
slopus:mainfrom
suntaoathome:fix/debug-large-json-production

Conversation

@suntaoathome

Copy link
Copy Markdown
Contributor

Logger.debugLargeJson() logs that message inspection is skipped when DEBUG is disabled, but it does not return. It still recursively traverses, serializes, and writes the payload to disk. This adds the missing early return and a regression test. Debug-mode behavior is unchanged.

Proof

A production daemon log created before the fix contained both the skip marker and the supposedly skipped socket payloads:

skip_markers=83946
socket_update_payloads=83632

With the fix running:

skip_markers=2694
daemon_environment_payloads=0
socket_update_payloads=0

The regression test uses an enumerable getter that throws if the payload is inspected. The call now returns without touching it.

Tests

pnpm --filter happy exec vitest run src/ui/logger.test.ts

Test Files  1 passed
Tests       1 passed
pnpm --filter happy build

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.

1 participant