Skip to content

fix(gateway): keep an astral plugin runtime error whole at the report cap - #181742

Merged
obviyus merged 2 commits into
openclaw:mainfrom
wangmiao0668000666:fix/plugins-runtime-error-astral
Oct 24, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
wangmiao0668000666:fix/plugins-runtime-error-astral

Conversation

@wangmiao0668000666

@wangmiao0668000666 wangmiao0668000666 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

plugins.list could split an astral character at the 2,000 UTF-16-unit runtime-error cap, returning a lone surrogate to RPC consumers. Reuse truncateUtf16Safe, as in #176207 and #176230, without changing the cap or runtime-state reporting.

Evidence

Built main 143bae697ddc27e6ff491fe028e6facb41e40526 and the candidate in isolated Node 24.22.1 Docker. A normally configured local plugin service throws an emoji error; the shipped Gateway and gateway call plugins.list --json expose its runtime failure.

  • Main, twice: 2,000 units, not well formed; actual RPC error ends 😀😀😀\ud83d.
  • Candidate, twice: 1,999 units, well formed; actual RPC error ends 😀😀😀.
  • Main short-error control, twice: 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.

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Use 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.

  • Before: The 2,000-unit result ends with a lone high surrogate.
  • After: The result contains the 1,999-character prefix without splitting the emoji.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal, correct repair with supplied shipped-RPC before/after evidence and one focused regression; outstanding CI process state does not lower patch quality.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied isolated Node 24.22.1 Gateway results exercise a normally configured failing plugin service through the shipped plugins.list CLI RPC, showing malformed 2,000-unit baseline errors becoming well-formed 1,999-unit candidate errors with an unchanged short-error control; the relevant files remain identical at the reviewed head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Long plugin runtime failures can reach RPC clients with a dangling surrogate instead of a complete character.
Reason: The repair preserves the existing diagnostic limit and runtime-state contract without new configuration, APIs, or machinery.

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
Reviewed head: 95f183775ba72f0cf5570147244c496b88adfacb

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied RPC red/green evidence covers the shipped behavior, but execution of the committed regression on both base and head is not explicitly recorded.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Plugin runtime error projection keeps the original intent (b5134de: Expose current plugin runtime state and service failures through restart-free Gateway plugin management.)
  • Handler test registry scope keeps the original intent (4345ea5: Consolidate handler tests and remove low-value coverage; the optional registry argument preserves existing callers while supporting a distinct payload regression.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +1, Tests +23. Total +24 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 25 2 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 27 3 +24

Labels

Label changes:

No label changes.

Label justifications:

  • P3: The defect affects diagnostic text at a specific Unicode boundary without changing plugin execution or availability.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-23T16:19:44.892Z sha e677cc87ff169c5019a9374939020d5a67544eb3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-24T01:33:06.402Z sha b992893 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-24T02:09:41.663Z sha b992893 :: needs maintainer review before merge. :: none

Reviewed October 24, 2026, 10:56 AM ET / 14:56 UTC (Revision 4).

@wangmiao0668000666
wangmiao0668000666 force-pushed the fix/plugins-runtime-error-astral branch from e677cc8 to b992893 Compare October 23, 2026 16:32
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 24, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 24, 2026
@obviyus

obviyus commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 24, 2026
@obviyus
obviyus merged commit aa45e56 into openclaw:main Oct 24, 2026
128 of 129 checks passed
@obviyus

obviyus commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Landed in aa45e56. Thanks @wangmiao0668000666. plugins.list errors no longer split emoji.

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

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!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
… 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]>
@wangmiao0668000666
wangmiao0668000666 deleted the fix/plugins-runtime-error-astral branch October 28, 2026 07:39
RomneyDa added a commit that referenced this pull request Oct 28, 2026
… 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants