Repository navigation
fix(android): synchronize realtime tool completions - #100049
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (4 earlier review cycles)
|
|
@clawsweeper automerge |
|
Hi! Small heads-up: ClawSweeper had a short-lived label/comment sync bug that may have affected this PR. Your latest ClawSweeper review comment appears to be for the current PR head and says this is ready for maintainer review, but the ready/proof/rating labels were later removed by stale local review state. The ClawSweeper fix has merged, but this PR needs a fresh author-triggered review so the labels and comment are reconciled again. Could you please post a new comment asking ClawSweeper to re-review? Use the bot mention followed by Thanks, and sorry for the noise. |
b88ffe9 to
96524a6
Compare
|
Final exact-head proof (supersedes the earlier pre-sync SHA):
Land-ready once exact-head hosted checks finish. |
c5e5b7f to
7fd7cf7
Compare
7fd7cf7 to
572be2f
Compare
|
Merged via squash.
|
* fix(android): synchronize realtime tool completions * refactor(android): unify realtime tool completion state --------- Co-authored-by: Peter Steinberger <[email protected]>
Related: #99968
What Problem This Solves
Fixes an issue where Android Talk Mode realtime agent-consult replies could stay stuck in
Thinking...when the Gateway chat final event arrived before Android finished registering the realtime tool-call run metadata.Why This Change Was Made
Android receives realtime talk events and Gateway chat events concurrently. This change protects the realtime tool run maps and pending completion cache with a dedicated lock, records final/error completions that arrive while a tool call is still pending, and dispatches the eventual
talk.session.submitToolResultafter leaving the lock so network I/O does not run inside the synchronized section.Cached pending completions are bounded with the existing Talk Mode cache cap, and a regression test covers the final-before-run-metadata ordering.
User Impact
Android realtime Talk Mode can complete agent consult tool calls reliably instead of losing the result when the tool-call RPC response and chat final event race.
Evidence
b88ffe9fc8.git diff --check- passed.PYTHONUTF8=1 PYTHONIOENCODING=utf-8 python .agents\skills\autoreview\scripts\autoreview --mode commit --commit HEAD- passed,autoreview clean: no accepted/actionable findings reported.pnpm native:i18n:syncrefreshedapps/.i18n/native-source.jsonafter the Android source line shifts.pnpm native:i18n:check- passed,native-app-i18n: entries=2489 changed=false.OpenClawAndroid/2026.6.11-dev (Android 16; SDK 36).talk.session.createstarted realtime sessionrelay-android-race-proof.talk.eventtype:"toolCall"foropenclaw_agent_consult.talk.client.toolCallwithcallId:"call-android-race-proof".talk.session.submitToolResult:{"sessionId":"relay-android-race-proof","callId":"call-android-race-proof","result":{"text":"Android realtime tool race proof ok"}}{"ok":true,"normal":null,"realtime":{"mode":"realtime","status":"Thinking...","userText":"Android realtime tool race proof user","assistantText":"Android realtime tool race proof ok"}}TalkMode: realtime session started relaySessionId=relay-android-race-proofVoiceE2E: PASS {"ok":true,"normal":null,"realtime":{"mode":"realtime","status":"Thinking...","userText":"Android realtime tool race proof user","assistantText":"Android realtime tool race proof ok"}}cmd /c gradlew.bat :app:testPlayDebugUnitTest --tests ai.openclaw.app.voice.TalkModeManagerTest; it timed out after roughly 184s on this Windows host without reporting a test failure.OPENAI_API_KEY; Android timed out beforetalk.session.create, so that attempt is not used as proof for this PR.