Repository navigation
fix(streaming): keep fitting emoji and accents intact in prose replies - #166567
Conversation
Signed-off-by: Rudy Celekli <[email protected]>
Signed-off-by: Rudy Celekli <[email protected]>
Signed-off-by: Rudy Celekli <[email protected]>
|
🦞👀 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. Reviewed October 7, 2026, 8:43 AM ET / 12:43 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR keeps fitting emoji and combining accents together at hard length cuts in streamed prose replies and adds chunker and subscription-delivery regressions. Merge readiness✅ Ready for maintainer review This remains a useful fix absent from current main and the latest release. No introduced correctness or security defect was found; the new exact-head Telegram delivery transcript satisfies the earlier proof request. The inherited CI failure remains a landing-gate matter. Priority: P2 Review scores
Verification
How this fits togetherThe shared reply chunker turns incoming model text into bounded blocks before channel delivery. Its boundaries determine whether a displayed character stays together in outgoing messages. flowchart TD
A[Model text deltas] --> B[Agent session subscription]
B --> C[Shared reply chunker]
C --> D{Safe prose boundary}
D -->|Needs lookahead| E[Buffered text]
E --> C
D -->|Ready or final drain| F[Bounded reply blocks]
F --> G[Channel delivery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +24, Tests +133. Total +157 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep grapheme boundary selection in the existing shared prose chunker while preserving transport budgets, source custody, and established Markdown splitting. Do we have a high-confidence way to reproduce the issue? Yes. The supplied current-main Test Server transcript reproduces family-emoji and accent splits at the default 1,200-unit block cap; source inspection confirms the same fallback remains on fetched main. Is this the best way to solve the issue? Yes. The patch repairs the existing prose boundary owner using the established grapheme helper, with bounded oversized-cluster progress and direct channel-delivery evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5a138f131cf8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
Telegram Test Server block-delivery proofVerified the unchanged head The Convex-leased TDLib QA user sent a DM to the leased Test Server bot and recorded the bot's actual delivered messages. Doctor passed; each lease was released. Bot/user/chat identifiers are omitted below. The OpenAI-compatible mock emitted seven-UTF-16-unit SSE deltas, 5 ms apart:
Both refs used the default block chunker ( Observed messagesIDs below are the observing user's server message IDs (
The exact family boundary on main was: Candidate reply 67509 ends in ASCII Main's accent boundary was For all four successful turns, concatenating the delivered texts exactly reproduced the fixture and every message was ≤1200 UTF-16 units. Each candidate grapheme occurred wholly within one message. Mock request counts were 2 for main/family and 3 for each other turn (including auxiliary requests). An excluded main/accent transport attempt reached no provider; after a fresh doctor and isolated-port retry, the recorded successful result is the one above. The recording command for each case was the repository Supporting checks
CI classificationThe latest completed exact-head CI run has Cancelled jobs: 0 in that completed run. Skipped conditional matrix placeholders are not cancelled selected jobs. No CI jobs were rerun, no commits were pushed, and the PR body was not changed. This comment supplies the outstanding real-delivery evidence for re-review of the same SHA. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer override: the only failing job on exact head 0216d75 is |
|
Landed in 627d16b. Thanks @rudycelekli! Verified on the Telegram Test Server: main split a family emoji and a combining accent across two messages at the 1,200-character cut; with this both stay whole, the text is complete, and every message stays within the limit. |
openclaw#166567) Keep a grapheme that fits within the reply budget (family or flag emoji, skin-tone sequences, combining accents) whole when block-streamed prose crosses the hard chunk limit, instead of splitting it across replies. Chunks stay within the limit and the concatenated text is unchanged. Fixes openclaw#166562. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #166562
What Problem This Solves
Fixes emoji and accented characters being divided between block-streamed prose replies when they cross the hard character cut.
User Impact
A character that fits the complete reply budget stays together, including family emoji, flags, skin-tone modifiers and combining accents. Oversized clusters retain bounded progress; transport limits remain enforced. This does not change fenced-code or whitespace splitting into a Unicode-aware feature.
Why This Change Was Made
The prose fallback cut was surrogate-safe but could separate the code points making up one displayed character. It now reuses the existing normalization-core grapheme boundary helper. During streaming it waits for enough lookahead to establish the trailing cluster boundary; a whole leading cluster that fills the real cap can still progress immediately. Parser-confirmed closing fences keep their existing cuts, and source-range ownership stays intact.
The regression coverage also exercises actual
subscribeEmbeddedAgentSession→onBlockReplydelivery, using the repository's synthetic direct OpenAI Responses events. It requires complete authored text, an intact family emoji and bounded outgoing chunks for three event schedules.Evidence
Candidate:
0216d75b6508a9db7dcd08ade81dd8f80482bd2a. Source baseline:8242407539b5d783b8fb8793f54d7092b4bbbd5a. Supported Node 24.x, pinned frozen pnpm 12.5.1, physical owned-fork installation.Exact-head native before/after, changed checks and build, all successful at
0216d75b6508a9db7dcd08ade81dd8f80482bd2a. Original production with these tests has 7 intended failures / 105 passing tests; corrected production passes 112/112 across both suites. Original suite 53.83s (launcher wall 57.63s); candidate 42.42s (launcher wall 46.07s). Controls cover closing fences, tiny budgets, exact-cap and oversized clusters, source metadata and terminal drains.pnpm check:changed --base 8242407539b5d783b8fb8793f54d7092b4bbbd5apassed (2,290.29s wall), including type checks, pinned formatting, lint, ratchets, dead-code and runtime import-cycle guards.pnpm buildpassed (381.86s wall). These are owned-fork results, not a claim that the upstream PR's draft-skipped CI ran.Independent repository autoreview of the full semantic candidate is scoped-clean through P2. Earlier review/native failures were corrected while preserving existing assertions. The final commit applies only pinned oxfmt 0.68.0 formatting to the new subscription fixture. No full repository suite or live channel/Gateway end-to-end result is claimed.
Upstream CI is not fully green:
check-test-types-core-2fails with TS2353 atui/src/components/terminal/terminal-panel-fonts.test.ts:56(signalis not a declared boot parameter). CI checks test-merged10dc2977fb46d4eca4fc070a1cb985b9d3d7aeeinto basedfb27239f2b6265dad3d2059926f9cc86c34f2f3. The failing test and session-boot owner have identical blobs in that base and test-merge, and this PR changes neither file. This is recorded as an inherited base-source failure; it has not been fixed or waived here. Other upstream CI results may still be pending.Remaining behavior-proof gate
ClawSweeper found no introduced code/security defects but requires real Telegram Test Server delivery proof before merge. That live proof has not run and remains open. Credentialed execution requires maintainer-approved QA access; no account lease or live credentials were used here.
A maintainer test handoff pinned to this candidate provides the maintained mock-provider scenario, 1/17-code-point schedules, exact payloads, message-boundary acceptance checks, source identity and lease/process cleanup requirements. Its 14 offline fixture checks pass; those checks do not replace real Telegram delivery evidence. The PR is available for review while this merge gate remains unresolved.
The existing link-preservation proposal #151242 touches the same owner for a different cause and may require mechanical reconciliation. Current main's production owner was checked and matches the pinned baseline. No dependencies, configuration or release artifacts change.
AI-assisted investigation and implementation. Maintainer edits are enabled.