[Repo Assist] improve: remove debug scaffolding and double-serialization from WindowsNodeClient#150
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Conversation
…wsNodeClient - Remove verbose debug block in SendNodeConnectAsync that logged sensitive data (auth token prefix, Ed25519 signature, full connect payload) on every connect attempt; this ran in all builds, not just debug. - Eliminate redundant BuildDebugPayload() call (was called twice: once for logging, once inside SignPayload) — only the SignPayload call remains. - Remove duplicate JSON serialization: msg was serialized twice (once with WriteIndented for the debug log, once compact to actually send); collapse to a single compact serialization and remove the now-unused s_indentedOptions field. - Remove HandleResponse debug log that allocated a full payload string just to truncate it for a Debug()-level message. No functional change; connection, signing, and registration behaviour are identical. Test status: 525 Shared passed, 99 Tray passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
14 tasks
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Removes leftover development-time debug scaffolding from
WindowsNodeClient.SendNodeConnectAsyncandHandleResponse, and eliminates a redundant JSON serialization.1. Remove sensitive debug logging block in
SendNodeConnectAsyncProblem: A
=== Debug Info ===block logged on every connect attempt included:auth.token)These messages fired at
Debuglevel in all builds (no#if DEBUGguard), viaNullLoggerwhich writes toConsole.WriteLineandAppLoggerwhich writes to a log file. While each message truncates aggressively, the pattern poses an unnecessary exposure risk.Additionally,
BuildDebugPayload()was called explicitly just for the log, then called again internally bySignPayload()— two allocations of the same string per connect.Fix: Keep only the
SignPayload()call; remove the logging block and the redundantBuildDebugPayload()call.2. Eliminate double JSON serialization in
SendNodeConnectAsyncProblem: The connect message object was serialized twice:
The debug log logged a pretty-printed version; the actual send used a separate compact serialization. Besides the unnecessary CPU/memory cost, the log and the wire payload were technically different strings (whitespace).
Fix: Serialize once, send it, remove the
s_indentedOptionsfield (now unused).3. Remove
HandleResponsedebug logProblem:
HandleResponseallocated a full JSON string frompayload.ToString()on every response, then truncated to 200 chars just to emit aDebug-level message. The// DEBUG:comment confirmed this was scaffolding.Fix: Remove the comment, the
payloadTextallocation, and the truncated log. The existing_logger.Warnfor missing payload is retained.Trade-offs
BuildDebugPayload()public method onDeviceIdentityis still present (used bySignPayloadinternally and by tests) — no public API changes.Test Status
OpenClaw.Shared.TestsOpenClaw.Tray.Tests