Skip to content

fix(voice-call): keep late caller transcripts ahead of replies - #191602

Merged
roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-159143
Nov 3, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-159143

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #159143, thanks @mnowrot.

Related: #159138

What Problem This Solves

Fixes realtime voice-call transcripts showing an assistant reply before the caller turn when speech recognition finalizes the caller late.

User Impact

Saved call dialogue and subsequent agent consultations retain the caller/reply order, including repeated caller phrases. Existing transcripts are unchanged; a provider with no speech-start event or partial text still uses the first available transcript timestamp.

Why This Change Was Made

Capture each speaker's observed turn start and pass it to the existing transcript-append owner, which orders entries by timestamp. Equal timestamps retain arrival order. Timestamp tracking resets on finalization, rejected caller finals, and provider continuity reset. This is only the core ordering repair; it does not add the original PR's cumulative-transcript ledger.

The change builds on #191584, #191537, and #191498. The pr-simplify pass retained only the timestamp path and owner ordering. Production growth is 13 lines for turn timestamps and owner ordering; there is no dead ordering implementation to remove. The regression adds 65 lines in an existing store integration suite, with a matching test-line allocation for carrier ingress through real SQLite persistence.

Evidence

  • Both late-finalization cases (partial text and provider speech-start) failed on main abeffef677121a92e8ea70274e18385a2d2a7ff9, storing each reply before its caller. The cases also preserve two distinct “Yes.” turns.
  • The same regression is green in Crabbox/Blacksmith Testbox: remote proof environment. Four named test files passed (132 tests, 71.77 seconds including worker setup): manager.async-store.test.ts, manager/events.test.ts, manager/outbound.test.ts, and webhook/realtime-handler.test.ts. This includes the existing greeting, echo, and continuity-reset coverage. Touched-file lint reported zero warnings/errors, and touched-file formatting passed.
  • Autoreview (Codex, P0–P2) completed on the full local change against that base: scoped-clean, no actionable findings. The review included unchanged manager outbound, runtime consultation, and event type context.
  • The contributor branch was read with gh pr view/gh pr diff and was never checked out or executed. Only the independently implemented replacement was executed, on the remote Testbox. No paid phone/provider call was made.
  • PR CI supplies broad validation. No broad tests, worker compilation, or repository-wide lint/typecheck ran on the production Team host. Native landing uses only the wrapper-managed frozen dependency cache; test dependencies and checks ran on the remote Testbox.

Carry observed turn starts into the transcript append owner so late caller finals retain dialogue order. Preserve repeated phrases and existing playback and persistence behavior.

Co-authored-by: Marcin Nowrot <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: S labels Nov 3, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 3, 2026 01:57
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) November 3, 2026 02:02
@roboclaw-bot
roboclaw-bot merged commit a5a98d5 into main Nov 3, 2026
196 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-159143 branch November 3, 2026 02:08
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…law#191602)

Fixes realtime voice-call transcripts recording a late-finalized caller turn after its assistant reply. Carry observed turn starts into the existing transcript-append owner and retain repeated utterances.

Supersedes openclaw#159143, thanks @mnowrot.
Related: openclaw#159138

The 65-line regression allocation covers real carrier WebSocket ingress through persisted SQLite dialogue order, including partial-text and speech-start paths and repeated caller phrases. Both cases failed on main; 132 focused tests and touched-file lint/format pass remotely. Independent Codex autoreview P0-P2 was scoped-clean.

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

Labels

channel: voice-call Channel integration: voice-call size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant