Repository navigation
fix(gateway): keep an astral plugin runtime error whole at the report cap - #181742
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: needs maintainer review before merge. What this changesUse the existing surrogate-safe truncation helper for plugin runtime errors returned by plugins.list. Example: A plugin error contains 1,999 ASCII characters followed by 😀 and additional text.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main Unicode truncation defect with a minimal change and a focused regression; no actionable code findings were identified. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway combines managed plugin inventory with registry and service-health facts, then returns runtime diagnostics to RPC consumers including the CLI and Control UI. flowchart LR
A[Managed plugin inventory] --> C[plugins.list projection]
B[Registry and service health] --> C
C --> D[Surrogate-safe error cap]
D --> E[Gateway RPC response]
E --> F[CLI and Control UI]
Technical reviewBest possible solution: Keep the existing projection and 2,000-unit cap, using the shared surrogate-safe helper with the focused handler regression. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically splits the shown surrogate pair, and supplied shipped-Gateway RPC results demonstrate matching before/after behavior; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete repair: reuse the existing truncation owner at the reporting boundary and test the observable RPC payload. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f919ca7ea83. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests +23. Total +24 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed October 24, 2026, 10:56 AM ET / 14:56 UTC (Revision 4). |
e677cc8 to
b992893
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in aa45e56. Thanks @wangmiao0668000666. plugins.list errors no longer split emoji. |
|
Thanks @obviyus for reviewing and merging this — keeping the astral plugin runtime error whole at the report cap preserves the full error detail for debugging. Appreciate it! |
… cap (openclaw#181742) fix(plugins): don't split an emoji in plugins.list runtime errors plugins.list cut a plugin's runtime-error text at 2000 UTF-16 units, which could split an emoji and return a lone surrogate (invalid Unicode). The cut now uses the existing truncateUtf16Safe owner and stops at a whole character. Evidence: built Gateway with a plugin whose service fails with an emoji-heavy error. On main plugins.list returned 2000 units ending in a lone U+D83D (twice); with this change it returns 1999 units of valid text (twice). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]>
… cap (#181742) fix(plugins): don't split an emoji in plugins.list runtime errors plugins.list cut a plugin's runtime-error text at 2000 UTF-16 units, which could split an emoji and return a lone surrogate (invalid Unicode). The cut now uses the existing truncateUtf16Safe owner and stops at a whole character. Evidence: built Gateway with a plugin whose service fails with an emoji-heavy error. On main plugins.list returned 2000 units ending in a lone U+D83D (twice); with this change it returns 1999 units of valid text (twice). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit aa45e56) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit c5b429de49cdb7bbbfa17f100306d8dad5941227)
What Problem This Solves
plugins.listcould split an astral character at the 2,000 UTF-16-unit runtime-error cap, returning a lone surrogate to RPC consumers. ReusetruncateUtf16Safe, as in #176207 and #176230, without changing the cap or runtime-state reporting.Evidence
Built main
143bae697ddc27e6ff491fe028e6facb41e40526and the candidate in isolated Node 24.22.1 Docker. A normally configured local plugin service throws an emoji error; the shipped Gateway andgateway call plugins.list --jsonexpose its runtime failure.😀😀😀\ud83d.😀😀😀.x: short 😀 failure, 19 units, well formed.The regression protects the RPC projection at the split-surrogate boundary. Simplification retains the existing truncation owner rather than introducing another policy: production +2/-1 lines; tests +25/-2 lines against main.
Thanks to @wangmiao0668000666 for reporting and fixing this.
Two-way door: reverting restores the previous projection; no stored state or configuration changes. Blast radius is plugin runtime failure text returned by
plugins.list.