fix(chat): tool titles corrupt boundary emoji in long inputs#104464
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 11, 2026, 1:38 PM ET / 17:38 UTC. Summary PR surface: Source +1, Tests +32. Total +33 across 4 files. Reproducibility: yes. Current main deterministically bisects the supplied emoji with raw Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the existing 2,000-code-unit contract and land this shared-helper substitution at both the browser producer and Gateway trust boundary, retaining full redaction before Gateway truncation and the focused boundary tests. Do we have a high-confidence way to reproduce the issue? Yes. Current main deterministically bisects the supplied emoji with raw Is this the best way to solve the issue? Yes. Reusing the repository's canonical browser-safe helper at the two independent input owners is the narrowest maintainable fix and avoids new APIs, fallback paths, configuration, or duplicate truncation logic. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against de8cfd2bf211. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +32. Total +33 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
Review history (1 earlier review cycle)
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(chat): tool titles corrupt boundary emoji in long inputs This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready maintainer proof for exact head
Known proof gaps: none for the touched behavior. |
|
Merged via squash.
|
…w#104464) * fix(chat): tool titles corrupt boundary emoji in long inputs * test(chat): simplify UTF-16 title boundary coverage * test(chat): satisfy title boundary lint --------- Co-authored-by: Peter Steinberger <[email protected]>
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users viewing a long command or generic tool call in Control UI could send corrupted text to the AI tool-title generator when an emoji crossed the existing 2,000-unit input limit.
Why This Change Was Made
Control UI now applies OpenClaw's canonical UTF-16-safe truncation to command text, raw string args, and serialized object args before hashing and scheduling
chat.toolTitles. The Gateway independently applies the same boundary after full-input secret redaction, protecting other RPC clients before cache keys and utility-model prompts are built.The security order remains unchanged: Gateway redacts the complete schema-bounded input first, then truncates. Existing 2,000-unit budgets, protocol limits, debounce/batching, cache scope, utility routing, and title output behavior remain unchanged. A fresh open-PR scan found no PR covering this UI-to-Gateway tool-title path.
User Impact
Model-generated purpose titles for long tool calls no longer receive a broken replacement glyph at an emoji boundary. Complete text within the current budget, secret redaction, cached titles, deterministic fallback labels, and all opt-in behavior stay the same.
Evidence
Before the fix, both owners failed at the exact boundary:
After the fix, a real isolated OpenClaw Gateway ran with tool titles enabled and a deterministic local utility-model endpoint. The proof sent one unsafe direct Gateway request and one separate request through the production Control UI debounce path:
This exercises Control UI request eligibility and debounce, the real
chat.toolTitlesRPC handler, Gateway redaction/normalization/cache routing, utility-model HTTP requests, and the rendered title lookup.Full affected test files:
pnpm ui:buildpassed with 1,097 modules transformed.Targeted formatting passed for all four changed files.
Changed-surface checks passed, including core/core-test type checks, lint, dependency guards, database-first guard, runtime sidecar checks, and zero runtime import cycles.