You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Long Expo Device Hub diagnostics can split a UTF-16 surrogate pair at the 2,000-unit limit. A boot failure then carries a lone high surrogate before the ellipsis, which survives JSON and can display as a replacement character in the Device panel.
Deterministic repro on origin/main (4b8199987cb63f82912b8f3dbe9de6a96cdb057b): Open an unbooted Android AVD through the Device panel (device.open → DeviceService.open → POST /api/devices/boot). For the regression fixture, have the hub respond with ok: false and error: "a".repeat(1_998) + "🚀" + "b".repeat(10). Apply only the added test to base and run vp test run apps/server/src/device/DeviceService.test.ts -t 'keeps hub boot diagnostics well-formed when truncating at an emoji'.
Observed: the decoded DeviceBootError ends in \uD83D…; message.isWellFormed() is false.
Expected: the decoded diagnostic is "a".repeat(1_998) + "…"; message.isWellFormed() is true.
Change
Drop a trailing high surrogate from the truncated prefix before appending the ellipsis; keep the existing 2,000-unit cap and leave shorter messages alone. The shared server helper handles both boot errors and discovery warnings from local and SSH hubs, so web, desktop, mobile, and MCP consumers need no client or protocol changes.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Base failed with AssertionError: expected false to be true // Object.is equality; the same focused case passed on head. vp run check:changed exited 0, including 82 passing tests.
Real hub before/after transcript: an Android emulator executable permission error supplied an emoji at UTF-16 index 1,998. The decoded error changed from malformed (2,000 units) to well-formed (1,999 units).
Not shown: Web, desktop, and mobile rendering; live MCP transport; SSH and iOS hosts; discovery warnings in the runtime transcript.
Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).
Macroscope's review found this PR approvable — Device Hub diagnostics avoid leaving a split emoji at the truncation boundary while retaining the existing length limit. The change is confined to error and warning text, with no change to device operations or product defaults.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
Walkthrough
When diagnostics exceed 2,000 characters, boundDiagnostics removes a trailing unmatched high surrogate from the truncated prefix before adding an ellipsis. A regression test checks the decoded boot error message and the resulting diagnostics.
Changes: Boot diagnostics
Layer / File(s)
Summary
Truncation and regression test apps/server/src/device/DeviceHubOperations.ts, apps/server/src/device/DeviceService.test.ts
boundDiagnostics removes a trailing unmatched high surrogate before adding an ellipsis. The test checks that diagnostics truncated at an emoji boundary produce a well-formed decoded message and the expected 1,998-character prefix followed by an ellipsis.
Device Hub diagnostics truncated at the 2,000-character limit no longer end in a broken emoji character. The change is small and covered by a regression test, so no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the device hub diagnostic truncation at the 2,000-character limit now keeps surrogate pairs (emoji) whole. The raw summary confirms the change drops a trailing unmatch…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and a deterministic repro. The Change section explains the fix and w…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: the device hub diagnostic truncation at the 2,000-character limit now keeps surrogate pairs (emoji) whole. The raw summary confirms the change drops a trailing unmatched high surrogate before the ellipsis. The title is specific, follows conventional commit style, and matches the objectives.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and a deterministic repro. The Change section explains the fix and why no client changes are needed. Scope links no issue but explains why none is needed for a small obvious bug. Verification gives focused test results, a before/after transcript, and lists what was not checked. The optional agent-model line is present. The description does not include a UI screenshot, but the change has no UI rendering diff, so this is not required. The Scope section does not link an issue, which the template asks for unless an exception is stated, and the author states the exception.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 4b81999 and a7883ef.
Files selected for processing: 2
apps/server/src/device/DeviceHubOperations.ts
apps/server/src/device/DeviceService.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Problem
Long Expo Device Hub diagnostics can split a UTF-16 surrogate pair at the 2,000-unit limit. A boot failure then carries a lone high surrogate before the ellipsis, which survives JSON and can display as a replacement character in the Device panel.
Deterministic repro on
origin/main(4b8199987cb63f82912b8f3dbe9de6a96cdb057b): Open an unbooted Android AVD through the Device panel (device.open→DeviceService.open→POST /api/devices/boot). For the regression fixture, have the hub respond withok: falseanderror: "a".repeat(1_998) + "🚀" + "b".repeat(10). Apply only the added test to base and runvp test run apps/server/src/device/DeviceService.test.ts -t 'keeps hub boot diagnostics well-formed when truncating at an emoji'.DeviceBootErrorends in\uD83D…;message.isWellFormed()isfalse."a".repeat(1_998) + "…";message.isWellFormed()istrue.Change
Drop a trailing high surrogate from the truncated prefix before appending the ellipsis; keep the existing 2,000-unit cap and leave shorter messages alone. The shared server helper handles both boot errors and discovery warnings from local and SSH hubs, so web, desktop, mobile, and MCP consumers need no client or protocol changes.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
AssertionError: expected false to be true // Object.is equality; the same focused case passed on head.vp run check:changedexited 0, including 82 passing tests.Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).