Repository navigation
fix(reply): preserve streamed voice message order - #128558
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 2:25 AM ET / 06:25 UTC. ClawSweeper reviewWhat this changesThe PR makes deferred streamed audio flush surrounding text and itself before later reply blocks, preserving agent-produced delivery order. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking correctness finding in this focused owner-boundary repair. This PR remains open because its protected Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherThe shared reply pipeline receives streamed agent blocks, coalesces text, and holds audio until late voice metadata can be applied. It serializes resulting payloads to channel delivery handlers used by streamed replies. flowchart LR
A[Agent streamed blocks] --> B[Reply delivery handler]
B --> C[Shared reply pipeline]
C --> D[Text coalescing]
C --> E[Deferred audio buffer]
D --> F[Ordered delivery chain]
E --> F
F --> G[Channel delivery]
Decision needed
Why: The protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +61. Total +64 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep ordering policy in the shared reply pipeline rather than channel adapters; rebase onto current main and verify the exact head before a maintainer lands it. Do we have a high-confidence way to reproduce the issue? Yes, from source: enqueue text, an audio payload recognized by the audio buffer, then text or image; the prior path deferred audio without making it an ordering boundary. Is this the best way to solve the issue? Yes. The shared pipeline owns both deferred-audio finalization and serialized delivery, so fixing it there prevents channel-specific ordering policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d9c350ac7d18. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes an issue where users receiving streamed replies containing voice or audio attachments would see later text or images delivered before the audio. Text from opposite sides of an audio attachment could also be incorrectly combined into a single message.
Why This Change Was Made
The shared streaming reply pipeline buffered audio separately to preserve late-arriving voice presentation metadata, but did not treat that deferred audio as an ordering boundary. Flush earlier coalesced text when audio enters the buffer, then place buffered audio on the same ordered delivery chain before processing the next non-audio block. Late voice markers continue to apply before the audio is finalized.
User Impact
Streamed text, voice attachments, and images now arrive in the order the agent produced them across all channel implementations using the shared reply pipeline. Text is no longer merged across an intervening audio attachment, and late voice presentation metadata remains intact.
Evidence
node scripts/run-vitest.mjs src/auto-reply/reply/block-reply-pipeline.test.ts src/auto-reply/reply/reply-utils.test.ts src/auto-reply/reply/reply-delivery.test.ts src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts: 227 tests passed across four owner, sibling, delivery, and real-runner suites.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile /private/tmp/openclaw-audio-core.tsbuildinfoandnode scripts/run-tsgo.mjs -b test/tsconfig/tsconfig.core.test.messaging.json --builders 1: core production and messaging-test types both pass.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/auto-reply/reply/block-reply-pipeline.test.ts src/auto-reply/reply/block-reply-pipeline.ts../node_modules/.bin/oxfmt --check src/auto-reply/reply/block-reply-pipeline.ts src/auto-reply/reply/block-reply-pipeline.test.tsandgit diff --check.