Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:47 AM ET / 05:47 UTC. ClawSweeper reviewWhat this changesThe branch makes long Merge readinessThis PR remains necessary because current Priority: P2 Review scores
Verification
How this fits togetherA dashboard widget submits flowchart LR
A[Dashboard widget event] --> B[Gateway board-event handler]
B --> C[Widget validation]
C --> D[Board notice formatter]
D --> E[Surrogate-safe truncation]
E --> F[Session system-event queue]
F --> G[Next agent prompt]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +13. Total +16 across 3 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge this focused owner-boundary repair once the exact-head checks pass, retaining the shared truncation helper and the Gateway-level boundary regression as the canonical protection against malformed board notices. Do we have a high-confidence way to reproduce the issue? Yes—current main serializes the payload and truncates it with raw UTF-16 Is this the best way to solve the issue? Yes—the patch repairs the producer that creates the queued system-event text, using the existing supported surrogate-safe helper rather than adding a consumer-side cleanup or changing the public Gateway contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6922ddd93610. LabelsLabel 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
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3acc550 to
ad93d79
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
ad93d79 to
0ad3785
Compare
0ad3785 to
0dc6b85
Compare
0dc6b85 to
ae0bb86
Compare
ae0bb86 to
84ba5b9
Compare
|
Land-ready verification for original contributor head 84ba5b9: actual production board event notice on current main ends with a dangling UTF-16 high surrogate when an emoji crosses the 500-character boundary; the identical contributor-head invocation produces valid Unicode, preserves the existing ellipsis/widget suffix, and remains within the cap (length 500 -> 499). The existing canonical truncateUtf16Safe helper repairs the authoritative event producer without config/protocol/fallback changes. I folded the Gateway regression into the existing payload-cap boundary test, preserving real widget/event dispatch while satisfying the real max-lines rule without any suppression. Original three contributor-authored commits, exact three-file scope, and production fix are retained. Focused proof: OPENCLAW_VITEST_MAX_WORKERS=1 node /Users/steipete/Projects/openclaw/scripts/run-vitest.mjs src/gateway/server-methods/board.test.ts test/scripts/pr-wrappers.test.ts src/plugin-sdk/qa-runner-runtime.integration.test.ts (29 Gateway + 13 wrapper + 3 private-QA integration tests passed). Actual oxlint/oxfmt/diff checks passed; fresh full-branch Codex xhigh autoreview passed (0.99). The original branch was rebased only after canonical #117203 repaired the independently proven unrelated QA runner eager-load timeout; the formerly timing-out integration now completes in 14.8 seconds. Exact-head full hosted CI 30686337904 and real-behavior proof 30686336786 are GREEN, including lint, all Gateway/plugin suites, private-QA shard, security, QA Smoke profiles, and openclaw/ci-gate. |
|
Merged via squash.
|
* fix(board): preserve Unicode notice boundaries * test(board): document surrogate boundary * test(pr): isolate wrapper command inventory
What Problem This Solves
Long dashboard board.event payloads can split an emoji surrogate pair at the existing 500-character notice limit, publishing corrupted Unicode in the user-visible session event.
Outcome
What problem does this PR solve?
Dashboard widget events with long Unicode payloads could show a replacement character when the 500-character notice limit landed inside an emoji. The
board.eventGateway path could emit a lone UTF-16 surrogate into the session system event instead of a well-formed notice.What is the intended outcome?
Root-cause fix. Board notice formatting must preserve the existing 500 UTF-16-code-unit envelope and widget suffix without cutting a surrogate pair.
What is intentionally out of scope?
The public
board.eventrequest/response protocol, widget persistence, payload-size cap, deduplication window, notice limit, and configuration are not changed. The related open PR scan and current PR discussion did not identify a separate canonical contract change to adopt; this remains an internal board-notice normalization fix.Why This Change Was Made
The canonical owner is
src/boards/board-notices.ts, where the serialized payload becomes the queued human-readable notice. The old raw string slice could stop after an emoji's high surrogate. The fix uses the repository's shared surrogate-safe UTF-16 truncation capability at that owner boundary, beforeenqueueSystemEventstores text for the session consumer.The numeric subtraction is not a new product threshold: one UTF-16 code unit is reserved for the literal ellipsis already required by the notice format, while the existing 500-unit limit and full widget suffix remain unchanged. This fixes the normalization invariant rather than adding a downstream replacement-character cleanup.
The branch also keeps the existing
scripts/prwrapper fixture independent of the host's optionalrg,jq, andpnpminventory. That test-only change does not alter product or wrapper behavior.User Impact
Users can receive long dashboard widget event summaries without emoji or other supplementary Unicode characters being corrupted at the truncation boundary.
Risk
What is the highest-risk area?
The merge risk is availability and message integrity at the Gateway-to-session system-event boundary: an incorrect truncation budget could exceed the existing notice cap, remove the widget suffix, or change queue behavior.
How is that risk mitigated?
The change is confined to the canonical notice formatter, preserves every existing limit and queue contract, adds a focused boundary regression, and is backed by a live production-Gateway WebSocket run that observed the actual queued event. No public contract, persistence, or configuration surface changes.
Evidence
Fresh complete-branch xhigh autoreview passed with 0.99 confidence.
Verified current main publishes a 500-character notice containing a dangling high surrogate; repaired head publishes a valid 499-character notice with the same ellipsis and widget suffix.\n- Rebased-head Gateway board suite: 30/30 passed.\n- Rebased-head maintainer wrapper suite: 13/13 passed.
Exact current-main port head:
0ad37857e3de548855c778b50e57b7c2d716b84b.src/gateway/server-methods/board.test.ts: 28 tests passed, including the surrogate-boundary regression.test/scripts/pr-wrappers.test.ts: 12 tests passed. The local Git 2.27 runner used a bootstrap-only compatibility shim for newergit init -bandrev-parse --path-format=absolutesyntax; all other Git commands passed through unchanged.oxfmt --checkpassed for all three changed files.pnpm check:max-lines-ratchet --base f466c3de326e34f02caac610f601fffb8f413768passed on the exact synthetic merge preview (1136 grandfathered suppressions).Real Behavior Proof
An isolated production Gateway was started from the exact current head with temporary state and a loopback token. A real
GatewayClientWebSocket connection then:counterwidget throughboard.widget.put,board.get,board.eventwhose emoji high surrogate landed at the legacy truncation edge, andThis proof exercised production WebSocket authentication and routing, board handlers and store, JSON serialization, surrogate-safe truncation, and the real system-event queue. Only the loopback port, temporary configuration/state, authentication token, and final in-process queue observation were test-owned.