Skip to content

fix(android): synchronize realtime tool completions - #100049

Merged
steipete merged 2 commits into
openclaw:mainfrom
qingminglong:codex/99968-android-talk-proof
Jul 5, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
qingminglong:codex/99968-android-talk-proof

Conversation

@qingminglong

@qingminglong qingminglong commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

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.submitToolResult after 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

  • Current head: 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:sync refreshed apps/.i18n/native-source.json after the Android source line shifts.
  • pnpm native:i18n:check - passed, native-app-i18n: entries=2489 changed=false.
  • OPPO Reno15 / OPPO PLW110 / Android 16 ADB proof using the installed debug app and a local Gateway race harness:
    • Android connected as OpenClawAndroid/2026.6.11-dev (Android 16; SDK 36).
    • talk.session.create started realtime session relay-android-race-proof.
    • Gateway sent realtime talk.event type:"toolCall" for openclaw_agent_consult.
    • Android sent talk.client.toolCall with callId:"call-android-race-proof".
    • The harness delivered the chat final before returning the run id.
    • Android still submitted talk.session.submitToolResult:
      {"sessionId":"relay-android-race-proof","callId":"call-android-race-proof","result":{"text":"Android realtime tool race proof ok"}}
  • Android debug result:
    {"ok":true,"normal":null,"realtime":{"mode":"realtime","status":"Thinking...","userText":"Android realtime tool race proof user","assistantText":"Android realtime tool race proof ok"}}
  • Logcat included:
    • TalkMode: realtime session started relaySessionId=relay-android-race-proof
    • VoiceE2E: PASS {"ok":true,"normal":null,"realtime":{"mode":"realtime","status":"Thinking...","userText":"Android realtime tool race proof user","assistantText":"Android realtime tool race proof ok"}}
  • Attempted 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.
  • Also attempted a live OpenAI Realtime gateway run with a user-provided OPENAI_API_KEY; Android timed out before talk.session.create, so that attempt is not used as proof for this PR.

@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 7fd7cf7f0a3ba47e0cd835ff737f510199c2e713, but the PR head is now 572be2f8d0a9597ddf78670c21b4bd7fcf9bb320. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (4 earlier review cycles)
  • reviewed 2026-07-04T18:26:54.879Z sha 3dbd5825ccbf4877a7039ae48826a3e168a8c786 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T18:40:41.354Z sha b88ffe9fc81d5b0ae6a4d4435989b07e1b2d0328 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T18:46:06.564Z sha b88ffe9fc81d5b0ae6a4d4435989b07e1b2d0328 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T23:00:15.768Z sha 96524a62ff9b33be953072e1bbb109c5915af1e0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 4, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@brokemac79

Copy link
Copy Markdown
Contributor

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 re-review.

Thanks, and sorry for the noise.

@steipete steipete self-assigned this Jul 5, 2026
@steipete
steipete force-pushed the codex/99968-android-talk-proof branch from b88ffe9 to 96524a6 Compare July 5, 2026 22:51
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@steipete

steipete commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Final exact-head proof (supersedes the earlier pre-sync SHA):

  • Reviewed head: 572be2f8d0a9597ddf78670c21b4bd7fcf9bb320; only the intended Android i18n, runtime, and regression-test files differ.
  • Sanitized public AWS Crabbox: cbx_2753abf145bc, run run_3f0fd3b8109a. JDK 17 + Android SDK 36, isolated Gradle caches, exact-head assertion, public networking, no Tailscale/instance role.
  • Focused proof: :app:testPlayDebugUnitTest --tests ai.openclaw.app.voice.TalkModeManagerTest — BUILD SUCCESSFUL.
  • Fresh autoreview: no accepted/actionable findings; correctness 0.94.
  • Native review artifacts revalidated at this head; zero findings.

Land-ready once exact-head hosted checks finish.

@steipete
steipete requested a review from a team as a code owner July 5, 2026 23:11
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling extensions: codex extensions: google extensions: copilot labels Jul 5, 2026
@steipete
steipete force-pushed the codex/99968-android-talk-proof branch from c5e5b7f to 7fd7cf7 Compare July 5, 2026 23:18
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling extensions: codex extensions: google extensions: copilot size: XL labels Jul 5, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@steipete
steipete force-pushed the codex/99968-android-talk-proof branch from 7fd7cf7 to 572be2f Compare July 5, 2026 23:35
@steipete
steipete merged commit 6a62a04 into openclaw:main Jul 5, 2026
74 checks passed
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(android): synchronize realtime tool completions

* refactor(android): unify realtime tool completion state

---------

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

Labels

app: android App: android P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants