fix(node): validate JSON sends and trace invoke replies - #54
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 12, 2026, 12:16 PM ET / 16:16 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch validates complete JSON sends, traces camera and device-information replies, and carries preceding Tab5 camera, allocation-diagnostic, and firmware-packaging repairs. Merge readiness⛔ Blocked before merge - 3 items remain The correction remains necessary on main, and no concrete introduced defect was found. New device observations address the previous hardware-proof concern; this maintainer-authored stack remains open. Priority: P2 Review scores
Verification
How this fits togetherThe ESP node receives Gateway commands, runs device handlers, and sends JSON results over WebSocket. The stacked Tab5 changes also affect camera capture, image conversion, and firmware build verification. flowchart TD
A[Gateway command] --> B[Device handler]
B --> C[JSON result envelope]
C --> D[WebSocket send]
D --> E{Complete positive byte count}
E -->|Yes| F[Local send success]
E -->|No| G[Existing failure handling]
B --> H[Bounded diagnostic records]
D --> H
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land complete-send validation with the accepted predecessor repairs preserved, while keeping device-upgrade qualification and release approval separate from source landing. Do we have a high-confidence way to reproduce the issue? Yes: current main accepts zero or short SDK returns as success, and the pinned SDK explicitly returns zero on a failed nonempty write. This was established from source, without executing a current-main reproduction. Is this the best way to solve the issue? Yes: comparing the returned byte count with the complete serialized length reuses existing failure paths, while stack-local numeric diagnostics preserve envelopes, ownership, and logging controls. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 6b63951f0ac5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Problem
The shared JSON sender treats every nonnegative SDK return as success. The
pinned WebSocket client can return zero when a nonempty write fails, so the
existing invoke warning and Gateway-request failure callback can be suppressed.
A short return must not count as a complete JSON send either.
Separately, a bounded camera trial reached the existing pipeline release
marker but delivered no invoke result before the Gateway timeout. That marker
precedes handler payload construction and does not establish handler return
or transmission. This change does not claim the zero-return defect caused
that trial's timeout.
Stacked on #53.
Changes
Negative, zero, and short results use existing failure and cleanup paths,
including non-invoke Gateway requests.
camera.snapand
device.infoinvocations. At most nine fixed numeric records coverhandler return, envelope construction, serialization, SDK send, and local
completion after frees.
drivers, retries, and public configuration. INFO follows existing logging
controls; no global verbosity or WebRTC logging change.
names, session material, remote error text, or per-fragment tracing.
its cJSON source is configured.
Validation
and short-send error-callback assertions; negative and full returns pass.
-Wall -Wextra -Werror.The fixture executes the actual protocol functions with real cJSON and
bounded transport/handler stubs, covering full/negative/zero/short sends,
unchanged envelopes, serialization allocation failure, blocked-send
marker ordering, exact cleanup, quiet logging, and synthetic secret
exclusion. No production test exports.
git diff --checkpass.P0-P2 issues in the frozen five-file change.
CI run 34537672287,
attempt 1, for head
8e824973093329e5efe6034a6bc15e41f7146e52.The component job also executes the focused reply fixture.
78db4028765f59628c95a0ddd6cb9cd862a8b7d2e871d0388d19926528cc15f2.It compiled synthetic merge
5ec58db4c226a0b7cf1b078fc7a452444fd9099e(app version5ec58db);the merge parents and tree match the intended base and head.
mappings verified. Generated configuration, parsed dependency lock,
SDK/component patches, and protected partition ranges match the preceding
verified PR53 artifact. The SDK build remains
v5.5.5-648-g362a1776ec2-dirtywith the existing tracked patches, not apristine release tag.
Limits
SDK acceptance and local completion are not Gateway acknowledgement or
end-to-end delivery. Envelope construction returning does not certify every
child allocation;
alloc_failedrecords an absent serialized buffer, notan independently localized heap fault. The existing timeout is not an
aggregate RPC deadline.
The verified
5ec58dbcandidate was subsequently flashed with four writes andindependent readbacks passing. One camera trial recorded an SDK return of zero
for a 69,546-byte serialized response; the diagnostic correctly reported a
failed send. A later keyless trial on the same image accepted all 82,374 bytes
in 6,718 ms, and the Gateway returned a decoded 630x1120 JPEG of 61,562 bytes.
The larger successful response rules out a universal 64 KiB send ceiling; it
does not explain or repair the earlier intermittent zero return.
Recognizable camera output was observed, but color remained uncalibrated.
There is no successful voice qualification or established cause for the
earlier timeout/disconnect. No SDK or dependency change is part of this repair.
Maintainer Disposition
Accept the complete-length send contract and bounded diagnostics independently
of unresolved transport intermittency and voice qualification. Land after
#53 with a merge commit and
the verified cumulative tree, preserving signed history and predecessor repairs.
The physical observations identify their historical image, not a new live test
of the cumulative landing tree. No release is authorized.