Repository navigation
fix(facetime): keep emoji whole at the transcript entry cap - #187432
xialonglee wants to merge 1 commit into
Conversation
|
🦞👀 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 real behavior proof before merge. What this changesThis PR prevents FaceTime transcript truncation from splitting UTF-16 surrogate pairs. Example: A final transcript contains 1,999 ASCII x characters followed by 😀 and tail.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a concrete truncation defect still present on current main, using the existing SDK helper without introducing additional machinery or a correctness finding. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe FaceTime talk driver receives finalized realtime transcripts, bounds their in-memory history, and passes that history through the consult controller into the configured agent's prompt. flowchart LR
A[Realtime transcript callback] --> B[FaceTime talk driver]
B --> C[SDK surrogate-safe truncation]
C --> D[Bounded transcript history]
D --> E[FaceTime consult controller]
E --> F[Agent consult prompt]
Technical reviewBest possible solution: Retain the focused replacement with the existing surrogate-safe helper and its boundary regression. Do we have a high-confidence way to reproduce the issue? The current-main slice deterministically splits 1,999 ASCII characters followed by 😀 at the 2,000-unit boundary; the contributor also reports red-before/green-after regression and prompt-chain output, which this read-only review did not execute. Is this the best way to solve the issue? This is the smallest complete fix: the FaceTime owner retains its existing cap and history lifecycle while delegating surrogate handling to the established SDK helper. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 80dead1a1837. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +30. Total +31 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 30, 2026, 10:46 PM ET / October 31, 2026, 02:46 UTC (Revision 2). |
|
@clawsweeper re-review Real behavior proof has been added to the PR body ("Real consult-prompt chain proof" section), as requested. A temporary probe drove the shipped transcript-cap → consult-prompt path end to end — only the inherently external seams (realtime provider transport, macOS audio pump, realtime bootstrap instructions) were stubbed — and captured the exact prompt handed to the model boundary:
Head is unchanged since the last review (18325e3). Re-verified locally today: |
|
🦞👀 Re-review progress:
|
|
Thanks for the re-review. Addressing the remaining proof item as far as this environment allows: What the probe already ran as shipped (all on this PR's head): the talk driver's cap code, the real SDK transcript recording, the real What cannot be exercised on this host: the probe stubs exist precisely where the runtime is inherently external to this machine — the realtime provider transport, and the macOS FaceTime audio pump/helper. FaceTime capture and the audio pump are macOS-only APIs, so no Linux host can enter this path through the fully shipped FaceTime runtime; a "real provider, shipped runtime" run still keeps the macOS audio seam stubbed here. Given that, the remaining gap needs either a macOS host (real FaceTime runtime) or maintainer judgment. The fix itself has now been reviewed twice with zero findings, patch quality 4/6, CI green (ci-gate, prod types, lint, test types, changed-extension checks), and the full talk-driver suite passes locally on the head. Happy to help run a macOS-side capture if pointed at the expected harness. |
|
Thanks for the work here. We're closing this: it doesn't show a real user-facing problem (no report from an affected user and no natural reproduction), and it follows a pattern of small, speculative or duplicate changes split across many PRs. Please open an issue with a reproduction of real harm first; a fix can follow once the problem is confirmed. |
What Problem This Solves
Fixes: a FaceTime caller's transcript entry that ends with an emoji exactly at the 2,000-character cap leaves a lone UTF-16 surrogate in the text handed to the agent consult prompt.
User Impact
User impact: emoji and other supplementary-plane characters at the FaceTime transcript cap are no longer split into invalid lone surrogates, so consult prompts always carry well-formed text.
Why This Change Was Made
The transcript entry cap used a raw
slice(0, MAX_TRANSCRIPT_ENTRY_CHARS), which cuts by UTF-16 code units and can leave a lone high surrogate when an emoji straddles the cap. This was the one remaining naked text cap in the bundled FaceTime plugin; the rest of the repo was swept in the earlier "keep emoji whole at the cap" series (#186083, #181742, #182776, #101754). The cap now goes through the SDK facadetruncateUtf16Safe(openclaw/plugin-sdk/text-utility-runtime), the same pattern those merges used.Evidence
Before fix
New regression test
keeps emoji whole when capping transcript entries for the consult promptfailed: the transcript entry stored for the consult prompt was a 2,000-unit prefix ending in a lone U+D83D (cut emoji).After fix
Same test passes with the entry equal to a valid 1,999-unit prefix. Full file run: 20/20 tests pass (
node scripts/run-vitest.mjs run extensions/facetime/tests/talk-driver.test.ts).--tsconfig extensions/tsconfig.json): 0 warnings, 0 errors.tscfallback exceeded the local time budget; CI covers the extensions type lanes.Local diff review (openclaw-pr-review): PASSED, best-fix verdict, no findings.
Real consult-prompt chain proof (added in response to review)
A temporary vitest probe (deleted after the runs; not part of the diff) drove the shipped module graph end to end. Only the inherently external seams were stubbed — the realtime provider transport (
createRealtimeVoiceBridgeSession,resolveConfiguredRealtimeVoiceProviderAsync), the macOS audio pump, and the realtime bootstrap instructions builder. Everything in the transcript-cap → consult-prompt path ran as shipped: the PR'sstartFaceTimeTalkDrivercap code, the real SDK transcript recording, the realopenclaw_agent_consulthandling in the FaceTime consult controller, the realconsultRealtimeVoiceAgentsession machinery (session admission + fork against an isolatedcreateOpenClawTestStatestore, real runtime agent), and the realbuildRealtimeVoiceAgentConsultPrompt. The exact prompt handed to the model boundary (runEmbeddedAgent) was captured.Input transcript delivered by the provider callback: 1,999 ASCII
x+ 😀 (U+1F600, surrogate pair D83D DE00) +tail, final.Command:
(
--pool=forksbecause the real consult session machinery opens a shared-state SQLite worker store that admits only from a main thread.)Before fix (current-main
slicecap, same chain) — the malformed entry reaches the real consult prompt:(code point 55357 = U+D83D, a lone high surrogate.)
After fix (this PR's
truncateUtf16Safecap, same chain) — the boundary-crossing emoji is dropped whole; the prompt is valid:Full suite for the probe run:
Tests 2 passed (2)on the PR head; on the unpatched cap the chain test fails exactly on the lone-surrogate assertion (expected 'Caller: xxx…\uD83D' to be 'Caller: xxx…').Relates to gap finding: facetime transcript cap splits emoji (free_text, evidence level B).