Skip to content

fix: improve realtime barge-in and consult answers#608

Merged
rogerchappel merged 2 commits into
mainfrom
codex/fix-realtime-barge-in-results
Jun 1, 2026
Merged

fix: improve realtime barge-in and consult answers#608
rogerchappel merged 2 commits into
mainfrom
codex/fix-realtime-barge-in-results

Conversation

@rogerchappel
Copy link
Copy Markdown
Owner

Summary

  • Stop treating generic realtime consult finals like Done. as the actual OpenClaw answer when durable chat.history has the run's real assistant output.
  • Submit final realtime tool results as { result: text }, matching the installed OpenClaw Control UI implementation.
  • Make mobile/Capacitor barge-in more responsive by reducing the confirmation window and by no longer replacing likely user speech with silence while playback is active.

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 typecheck
  • pnpm 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...HEAD
  • pre-push hook: pnpm typecheck && pnpm build passed. Build emitted existing Turbopack NFT warnings around next.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.

@rogerchappel rogerchappel marked this pull request as ready for review June 1, 2026 00:43
@rogerchappel rogerchappel merged commit 181996f into main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant