Skip to content

fix(gateway): keep dashboard titles UTF-16 safe#101646

Closed
ly85206559 wants to merge 1 commit into
openclaw:mainfrom
ly85206559:codex/gateway-dashboard-title-utf16
Closed

fix(gateway): keep dashboard titles UTF-16 safe#101646
ly85206559 wants to merge 1 commit into
openclaw:mainfrom
ly85206559:codex/gateway-dashboard-title-utf16

Conversation

@ly85206559

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes dashboard session title truncation paths that could cut UTF-16 surrogate pairs in half. Both the generated display title normalization and the utility-model prompt input limit previously used raw .slice(...), which can leave malformed text when the boundary lands inside an emoji or other non-BMP character.

Why This Change Was Made

Recent title and channel truncation fixes use the shared truncateUtf16Safe helper for user-visible text. This applies the same existing helper to dashboard session title generation without changing title limits or model-selection behavior.

User Impact

Dashboard session titles and first-message title prompts stay well-formed when user messages or generated titles contain emoji or non-BMP characters near truncation boundaries.

Evidence

  • node scripts/run-vitest.mjs src/gateway/dashboard-session-title.test.ts
    • src/gateway/dashboard-session-title.test.ts passed in the gateway shard: 48 tests passed.
  • git diff --check
  • python .agents\skills\autoreview\scripts\autoreview --mode local --no-web-search
    • autoreview clean: no accepted/actionable findings reported
  • Base: latest origin/main at 2ba622ca30

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Jul 7, 2026
@ly85206559
ly85206559 marked this pull request as ready for review July 7, 2026 12:21
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open: the PR is a focused fix, but it leaves the real generated-title path incomplete because generateConversationLabel can still raw-slice the model output before dashboard normalization runs.

Canonical path: Close this PR as superseded by #101580.

So I’m closing this here and keeping the remaining discussion on #101580.

Review details

Best possible solution:

Close this PR as superseded by #101580.

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

Yes from source inspection: current main slices dashboard title strings by raw UTF-16 code units at the 60 and 1000 limits, and the PR still leaves a raw generated-label slice before normalization.

Is this the best way to solve the issue?

No: the helper choice is right, but applying it only in dashboard-session-title.ts is incomplete because generated labels can already be malformed when they reach the new normalizer clamp.

Security review:

Security review cleared: The diff only swaps string truncation helper usage and adds unit tests; it does not touch credentials, dependencies, workflows, or other supply-chain surfaces.

AGENTS.md: found and applied where relevant.

What I checked:

  • linked superseding PR: fix(gateway): preserve UTF-16 plugin approval fields #101580 (fix(gateway): preserve UTF-16 plugin approval fields) is merged at 2026-07-07T11:06:39Z.
  • cluster evidence: the durable review links that PR in the work cluster or recommended risk path.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

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

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 7, 2026
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Closed as superseded by #101685, landed in 176fee5d071dd03f6cbbc54b029f23380b04e911. The replacement carries this useful UTF-16 boundary fix on current main, uses the existing shared helper, expands caller-level coverage, and preserves your commit credit in the consolidated commit. Thank you, @ly85206559, for finding and fixing this.

@steipete steipete closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants