Skip to content

fix: preserve emoji at remaining bounded-text edges#101711

Merged
steipete merged 4 commits into
mainfrom
codex/utf16-final-boundaries
Jul 7, 2026
Merged

fix: preserve emoji at remaining bounded-text edges#101711
steipete merged 4 commits into
mainfrom
codex/utf16-final-boundaries

Conversation

@steipete

@steipete steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Related: #101679, #101684, #101692

What Problem This Solves

Fixes an issue where emoji and other supplementary Unicode characters could become malformed when text landed exactly on remaining length limits in Parallel search requests, compaction summaries, telemetry logs, system presence, workboard context and badges, or Control UI command metadata.

Why This Change Was Made

Routes each real text boundary through the shared UTF-16-safe slicing helpers at its owning core, UI, or plugin layer. This clean replacement also protects the compaction suffix-tail boundary missed by the source proposals, while omitting duplicate fixes already on main and unrelated formatting churn.

User Impact

Bounded text keeps valid Unicode at these edges: a complete character is retained or omitted, never split into a dangling surrogate. Existing length caps, markers, and fallback behavior remain unchanged.

Evidence

  • Blacksmith Testbox tbx_01kwyae3xcaszr9ckk2z1bg0ew: 407 focused behavior tests plus the 2-test Control UI browser-import contract passed.
  • Full check:changed passed, including guards, four typecheck lanes, and core/UI/package/extension lint.
  • Live keyless Parallel Search MCP request with Unicode input returned one result, a search id, and the expected normalized query.
  • Focused regression coverage asserts exact outputs at prefix, suffix-tail, marker, telemetry, presence-key, worker-context, badge, and remote-command boundaries.
  • git diff --check passed.
  • Fresh exact-branch Codex autoreview: clean at 0.98 confidence; no accepted/actionable findings.

Co-authored-by: ben.li <[email protected]>
Co-authored-by: 0668001336 <[email protected]>
Co-authored-by: Alix-007 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui extensions: diagnostics-otel Extension: diagnostics-otel agents Agent runtime and tooling plugin: workboard extensions: parallel labels Jul 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 7, 2026
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 10:46 AM ET / 14:46 UTC.

Summary
The branch replaces raw UTF-16 slicing at remaining bounded-text edges with shared surrogate-safe helpers and adds regression tests for the affected plugin, agent, infra, and Control UI paths.

PR surface: Source +12, Tests +134. Total +146 across 15 files.

Reproducibility: yes. source-reproducible. Current main uses raw String.slice at the affected bounded text caps, so a non-BMP character crossing the cap can leave a lone surrogate; the PR adds focused boundary tests for the changed paths.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: vector/embedding metadata: extensions/workboard/src/store.test.ts, vector/embedding metadata: ui/src/pages/workboard/view.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #101711
Summary: This PR is the consolidated bounded-text UTF-16 fix for the related same-day Parallel, workboard/UI/OTel, and compaction proposals.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • No repair lane is needed because no actionable patch defect was found; this maintainer-labeled PR should stay open for normal maintainer review and landing gates.

Security
Cleared: The diff only imports existing text helpers and adds regression tests; it does not change dependencies, workflows, secrets, permissions, or package/install surfaces.

Review details

Best possible solution:

Land the consolidated UTF-16 bounded-text fix after maintainer review and exact-head gates, preserving the existing limits and avoiding any new config or API surface.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible. Current main uses raw String.slice at the affected bounded text caps, so a non-BMP character crossing the cap can leave a lone surrogate; the PR adds focused boundary tests for the changed paths.

Is this the best way to solve the issue?

Yes. Reusing truncateUtf16Safe and sliceUtf16Safe at each owning boundary is the narrow maintainable fix; adding a new helper, config option, or transport-specific workaround would duplicate an existing shared contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fdc7892a6e5a.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports focused Blacksmith Testbox validation plus a live keyless Parallel Search MCP request with Unicode input after the fix, which is sufficient real behavior proof for this maintainer-labeled bugfix.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.

Label justifications:

  • P2: This is a normal-priority text correctness fix with limited blast radius across bounded display, request, telemetry, and context strings.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports focused Blacksmith Testbox validation plus a live keyless Parallel Search MCP request with Unicode input after the fix, which is sufficient real behavior proof for this maintainer-labeled bugfix.
Evidence reviewed

PR surface:

Source +12, Tests +134. Total +146 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 7 27 15 +12
Tests 8 143 9 +134
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 170 24 +146

What I checked:

Likely related people:

  • steipete: Blame on the current raw-slice blocks points to Peter Steinberger's recent main snapshot, and this PR consolidates related contributor proposals under his branch. (role: recent consolidation owner and current implementation contributor; confidence: high; commits: cba20f9aec7b, fc230db29512, d79d01eb2178; files: extensions/parallel/src/parallel-search-normalize.ts, src/agents/agent-hooks/compaction-safeguard.ts, extensions/workboard/src/store.ts)
  • Pandadadadazxf: Git history shows commit 9d15f5d added the compaction safeguard summary size behavior that the preserved-suffix truncation path descends from. (role: introduced earlier compaction budget behavior; confidence: medium; commits: 9d15f5dd746a; files: src/agents/pi-extensions/compaction-safeguard.ts, src/agents/pi-extensions/compaction-safeguard.test.ts)
  • nxmxbbd: Recent merged history touched the same compaction-safeguard module for tool-failure summary behavior, making this person relevant for compaction-path review context. (role: recent adjacent compaction contributor; confidence: medium; commits: 079397b2c385; files: src/agents/agent-hooks/compaction-safeguard.ts, src/agents/agent-hooks/compaction-safeguard.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-07T14:20:50.006Z sha 20a2c38 :: found issues before merge. :: [P3] Remove the release-owned changelog entry

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 7, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 7, 2026
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head d79d01eb2178ebcf3278d4a12cdfcc770642a23b:

  • GitHub CI run 28874551796: success, including build, guards, four typecheck/check lanes, lint, package/extension boundaries, all Node shards, and Telegram/matrix smoke.
  • Blacksmith Testbox tbx_01kwyae3xcaszr9ckk2z1bg0ew: 407 focused behavior tests passed across Parallel, diagnostics, workboard, agents, infra, and Control UI.
  • Blacksmith Testbox: the 2-test Control UI browser-import contract passed after its import allowlist was updated for the new browser-safe helper.
  • Blacksmith Testbox: full check:changed passed, including guards, four typecheck lanes, and core/UI/package/extension lint.
  • Live keyless Parallel Search MCP request with Unicode input returned one result, a search id, and the expected normalized query.
  • Fresh exact-head Codex autoreview: clean at 0.98 confidence; no accepted/actionable findings.
  • git diff --check: pass.

Known proof gap: the paid Parallel REST endpoint was not invoked. Its transport is unchanged, both Parallel runtimes share the tested normalization path, and the free MCP path was exercised live.

Native review artifacts validate with zero findings and READY FOR /prepare-pr.

@steipete
steipete merged commit 87fe266 into main Jul 7, 2026
113 of 115 checks passed
@steipete
steipete deleted the codex/utf16-final-boundaries branch July 7, 2026 14:48
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 8, 2026
* fix: keep remaining text bounds UTF-16 safe

Co-authored-by: ben.li <[email protected]>
Co-authored-by: 0668001336 <[email protected]>
Co-authored-by: Alix-007 <[email protected]>

* docs: credit bounded Unicode fixes

* test: update UTF-16 browser import boundary

* chore: leave Unicode note to release changelog

---------

Co-authored-by: ben.li <[email protected]>
Co-authored-by: 0668001336 <[email protected]>
Co-authored-by: Alix-007 <[email protected]>
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
* fix: keep remaining text bounds UTF-16 safe

Co-authored-by: ben.li <[email protected]>
Co-authored-by: 0668001336 <[email protected]>
Co-authored-by: Alix-007 <[email protected]>

* docs: credit bounded Unicode fixes

* test: update UTF-16 browser import boundary

* chore: leave Unicode note to release changelog

---------

Co-authored-by: ben.li <[email protected]>
Co-authored-by: 0668001336 <[email protected]>
Co-authored-by: Alix-007 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui extensions: diagnostics-otel Extension: diagnostics-otel extensions: parallel maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. plugin: workboard size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant