From c722e184962a7a6d1c28cf5ec24b0e6c938014fa Mon Sep 17 00:00:00 2001 From: Simen Svale Date: Tue, 30 Dec 2025 04:14:50 +0100 Subject: [PATCH] Skip debug logging for large response bodies (>1KB) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DisplayGet returns ~150KB of pixel data which was being logged to stderr, potentially causing crashes. Now shows just the size for large responses. 🤖 Generated with [Claude Code](https://claude.ai/claude-code) Co-Authored-By: Claude --- src/protocol/client.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/protocol/client.ts b/src/protocol/client.ts index 5e5cb31..9f71b86 100644 --- a/src/protocol/client.ts +++ b/src/protocol/client.ts @@ -198,7 +198,11 @@ export class ViceClient { const body = this.responseBuffer.subarray(12, totalLength); debugLog(`Parsed response: type=0x${responseType.toString(16)}, error=0x${errorCode.toString(16)}, reqId=${requestId}`); - debugLog("Response body", body); + if (body.length < 1000) { + debugLog("Response body", body); + } else { + debugLog(`Response body: ${body.length} bytes (too large to log)`); + } const response: ViceResponse = { responseType,