fix: improve realtime barge-in and consult answers#608
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Done.as the actual OpenClaw answer when durablechat.historyhas the run's real assistant output.{ result: text }, matching the installed OpenClaw Control UI implementation.Why
The previous timeout fix kept the consult open longer, but it still accepted live final text immediately. In the reported session, the live final was
Done., while the real user intent required a README summary. This PR treats that class of generic final as a placeholder and gives history recovery a chance to return the actual OpenClaw answer.For interruption, CrewCMD was detecting mic input during playback, but mobile echo suppression muted all input sent to the realtime provider until a strict barge-in threshold was reached. That made the transcript appear only after playback finished for short replies. This keeps quiet/echo frames suppressed but lets likely speech reach the provider while the barge-in confirmation completes.
Verification
pnpm vitest run src/lib/realtime-voice-gateway-relay.test.ts 'src/app/api/runtimes/[id]/talk/realtime/relay/route.test.ts'pnpm typecheckpnpm exec eslint src/lib/realtime-voice-gateway-relay.ts src/lib/realtime-voice-gateway-relay.test.ts 'src/app/api/runtimes/[id]/talk/realtime/relay/route.ts' 'src/app/api/runtimes/[id]/talk/realtime/relay/route.test.ts'git diff --check origin/main...HEADpnpm typecheck && pnpm buildpassed. Build emitted existing Turbopack NFT warnings aroundnext.config.ts/openclaw-config-parser.ts.Risk
Medium. This changes live voice interruption sensitivity and the provider-visible final tool result shape, but the latter now matches OpenClaw Control UI behavior.