Skip to content

feat(android): retain realtime calls through cleanup - #142298

Closed
roboclaw-bot wants to merge 4 commits into
openclaw/pr138726-split-s-statefrom
openclaw/pr138726-split-l-lifecycle
Closed

roboclaw-bot wants to merge 4 commits into
openclaw/pr138726-split-s-statefrom
openclaw/pr138726-split-l-lifecycle

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #138726 — Android realtime Talk.

What Problem This Solves

Android client-owned realtime calls must keep their selected chat and physical Gateway connection through delayed startup, agent work, transcript delivery and shutdown. Otherwise a retired call can lose accepted work or act on a replacement connection.

Why This Change Was Made

Keep the non-camera client and agent coordinator in one lifecycle: accepted transcript writes precede tool admission, late acknowledgements are retired, and cleanup performs one logical close. Relay steering uses the retained session ID; client-owned steering keeps its selected agent/chat target. The Wear test now checks the exact session-ID-owned control request.

User Impact

Provides target-bound realtime call handling without changing saved authentication or transport choices. Camera capability is not advertised by this layer. Call activation follows separately.

Evidence

Source-only correction — September 10, 2026

Head: 5a2b110d3d0239576949c1f194bbae6ba41cfdc8. Source-aware admission and native source verification pass. The L/U/K isolation correction passed 27 focused resource tests and canonical P0–P2 review with zero findings. The composed K descendant cc1a6ce946aa3df418da6e3e12ddc73a563a52d5 also passed all 3,059 Play app tests; this does not replace separate device or CI requirements.

  • Real WebSocket final admission: allowed consultFrames=1; retired consultFrames changed 1 → 0.

  • ACK registration: allowed acceptedConsults=1/abortFrames=0; retired abortFrames changed 0 → 1 at the exact ACK-confirmed agent/session/run.

  • 103 tests per Android flavor passed on the repaired complete-native candidate; stored XML, exits and frame observations were independently reviewed. Actual early-prefix validation is separate.

  • Split indentation/blank-line defects were repaired; ktlint and both Android lint variants passed on repaired production source.

  • Historical cleanup timeout was not reproduced in the original 101-case manager run or observation-only 2,991-test run. No longer timeout, weakened assertion, speculative cleanup rewrite or proven-flake claim.

  • Operator metadata opt-in was verified at the real WebSocket connect frame: failing before the producer fix, passing afterward. The 41-tests-per-flavor follow-up includes older hello and absent-metadata compatibility; no new reply requirement.

  • L owns the Talk status source/inventory entry. Generated status resources are deferred to the Main-only native locale refresh workflow; Camera capability remains absent.

  • Prior-source evidence, before source/generated isolation: the earlier published source tree passed both-flavor production/test-source compilation, the real-frame admission regression once per flavor, ktlint and canonical 21-locale/resource checks. Those results are not relabeled as a new build of the source-only resource composition.

Historical validation source tree: commit cdbd33585372eaec77bb5649308568e5d021e0a2. The local evidence above has its stated scope.

Native locale publication boundary

This is a source-only PR. Source/inventory changes and program behavior are retained; generated native locale dictionaries, lookup tables and XML are owned by the serialized Main-only Native App Locale Refresh workflow after source landing. Source-aware admission and inventory verification are distinct from strict generated-resource parity. No refresh or Main merge is performed by this PR update.

The new Talk state/details template uses the existing English-source/template fallback on this source-only branch until generated resources are published and included in a subsequent build. Its translation values remain in public history and the retained comparison set.

Worked on by:

Keep the non-camera client, selected wire target and coordinator together through accepted acknowledgements, transcript drain and logical close. Retired calls cannot start replacement work.

Verify Wear steering as an exact session-ID-owned request without redundant chat-routing fields.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android app: web-ui App: web-ui gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Sep 8, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 8, 2026 15:53
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 10:11 AM ET / 14:11 UTC (Revision 10).

ClawSweeper review

What this changes

Adds Android realtime call ownership that preserves the selected chat and Gateway connection through startup, agent work, transcript delivery, and cleanup, with lifecycle and protocol regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains distinct, useful work absent from current main and the latest release. Both earlier race findings are addressed; no remaining blocking defect was found in the pinned changes.

Priority: P2
Reviewed head: 5a2b110d3d0239576949c1f194bbae6ba41cfdc8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent lifecycle implementation with relevant real-transport proof, substantial regression coverage, and no remaining actionable finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Recorded local WebSocket observations exercise the production call owner, coordinator, and GatewaySession transport: allowed work reaches the socket, retired work is rejected, and late acknowledgements trigger target-specific aborts. This supports the lifecycle boundary; broader device activation and historical build results retain their separately stated scope.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded local WebSocket observations exercise the production call owner, coordinator, and GatewaySession transport: allowed work reaches the socket, retired work is rejected, and late acknowledgements trigger target-specific aborts. This supports the lifecycle boundary; broader device activation and historical build results retain their separately stated scope.
Evidence reviewed 9 items Pinned scope and review continuity: The introduced file list matches the host's merge-base-to-head inventory. Comparing the previous reviewed head with this head produced no changes in lifecycle production code or the selected lifecycle and WebSocket tests; the intervening changes concern locale publication.
Final-effect call admission: Client transport waits for accepted transcripts, then uses a synchronous admission guard sharing the retirement lock. GatewaySession additionally checks the captured physical connection after the transport mutex wait and immediately before WebSocket enqueue.
Acknowledgement and cleanup ownership: Acknowledgement registration decides retirement under the coordinator lock. Cleanup uses the acknowledged agent, session, and run through the retained client transport; logical close follows physical retirement and a bounded transcript drain.
Findings None None.
Security None None.

How this fits together

Android Talk receives realtime provider events and coordinates agent requests through the Gateway. This lifecycle layer binds those requests and transcript writes to the original call, then drains accepted work during shutdown.

flowchart TD
  A[Selected chat and Gateway connection] --> B[Realtime call owner]
  C[Provider events] --> B
  B --> D{Call and connection still current?}
  D -->|Yes| E[Gateway agent requests]
  B --> F[Ordered transcript delivery]
  D -->|Retired| G[Drain and close original call]
  E --> G
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +1609, Other +833. Total +2442 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 8 1612 3 +1609
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 5 849 16 +833
Total 13 2461 19 +2442

Review metrics

Metric Value Why it matters
Production versus test growth Production +832 lines net; tests and fixtures +1,609 lines net Production growth implements the new call lifecycle owner; test growth covers its ordering, retirement, and wire contracts.

Technical review

Best possible solution:

Keep call admission, acknowledged-run cleanup, and transcript draining under the captured call and connection owners while preserving existing relay behavior.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a standalone current-main bug report: this adds a lifecycle layer. The recorded production-boundary runs demonstrate the earlier branch races and their corrected outcomes.

Is this the best way to solve the issue?

Yes. Capturing one wire target and enforcing retirement at final enqueue addresses the lifecycle boundary directly without adding another persistence mechanism or changing saved provider preferences.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 878bc51433d4.

Labels

Label justifications:

  • P2: This is a bounded Android realtime lifecycle improvement, with activation handled separately and no demonstrated urgent shipped regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded local WebSocket observations exercise the production call owner, coordinator, and GatewaySession transport: allowed work reaches the socket, retired work is rejected, and late acknowledgements trigger target-specific aborts. This supports the lifecycle boundary; broader device activation and historical build results retain their separately stated scope.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded local WebSocket observations exercise the production call owner, coordinator, and GatewaySession transport: allowed work reaches the socket, retired work is rejected, and late acknowledgements trigger target-specific aborts. This supports the lifecycle boundary; broader device activation and historical build results retain their separately stated scope.

Evidence

What I checked:

  • Pinned scope and review continuity: The introduced file list matches the host's merge-base-to-head inventory. Comparing the previous reviewed head with this head produced no changes in lifecycle production code or the selected lifecycle and WebSocket tests; the intervening changes concern locale publication. (apps/android/app/src/main/java/ai/openclaw/app/voice/TalkRealtimeClient.kt:42, 5a2b110d3d02)
  • Final-effect call admission: Client transport waits for accepted transcripts, then uses a synchronous admission guard sharing the retirement lock. GatewaySession additionally checks the captured physical connection after the transport mutex wait and immediately before WebSocket enqueue. (apps/android/app/src/main/java/ai/openclaw/app/voice/TalkRealtimeClient.kt:101, 5a2b110d3d02)
  • Acknowledgement and cleanup ownership: Acknowledgement registration decides retirement under the coordinator lock. Cleanup uses the acknowledged agent, session, and run through the retained client transport; logical close follows physical retirement and a bounded transcript drain. (apps/android/app/src/main/java/ai/openclaw/app/voice/RealtimeAgentCoordinator.kt:291, 5a2b110d3d02)
  • Recorded production-boundary proof: The captured PR body, sourceRevision 39dc567ff23d8ddc807f1ac745857d23cbf033a09ecf224e3736560a46c6eb1d, records real WebSocket observations: allowed consultFrames=1, retired consultFrames changing from 1 to 0, and retired ACK cleanup changing from 0 to 1 abort frame at the acknowledged target. Inspected harnesses use the production call/coordinator owners and real GatewaySession WebSocket transport. Historical results retain their stated source binding; the older cdbd335 object was unavailable for an independent local comparison. No tests were executed during this review. (apps/android/app/src/test/java/ai/openclaw/app/gateway/GatewaySessionReconnectTest.kt:175, 5a2b110d3d02)
  • Compatibility and transcript contracts: Tests cover older hello responses without new metadata, rejected mismatched chat owners, retained connection capabilities, one logical close, and bounded transcript drain. The shared transcript fixture is checked against Android-emitted envelopes and the Gateway protocol schema; relay steering remains session-ID-owned. (packages/gateway-protocol/src/talk-android-transcript.test.ts:6, 5a2b110d3d02)
  • Current-main necessity: Current main's coordinator supports relay sessions without the introduced client transport or client-run abort cleanup. Its Android voice tree has no TalkRealtimeClient. The latest supplied release tree, v2026.9.3 at 1391f7c, also lacks that client. Existing Android documentation describes relay behavior; this branch intentionally leaves activation to the subsequent stack layer. (apps/android/app/src/main/java/ai/openclaw/app/voice/RealtimeAgentCoordinator.kt:18, 878bc51433d4)

Likely related people:

  • IWhatsskill: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-08T16:54:07.157Z sha b49b0b7 :: needs real behavior proof before merge. :: [P2] Serialize call retirement with the final request enqueue | [P2] Decide acknowledgement cleanup during locked run registration
  • reviewed 2026-09-08T19:45:06.216Z sha cdbd335 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T19:54:14.587Z sha cdbd335 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T20:28:16.187Z sha cdbd335 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T21:23:30.891Z sha cdbd335 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T10:08:34.720Z sha 40f129e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T15:17:37.912Z sha 8f2929d :: blocked before merge. :: none
  • reviewed 2026-09-10T11:23:45.414Z sha b76af82 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 8, 2026
@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 8, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/pr138726-split-l-lifecycle branch from cdbd335 to 40f129e Compare September 9, 2026 09:56
Integrate the reviewed owner-scoped repairs and updated stack prerequisite.
Retain the validated L layer source with only the inherited legacy agent-binding fix.
Preserve the historical secondary parent and the validated layer source while restacking its prerequisite.

Co-authored-by: IWhatsskill <[email protected]>
Worked on by:
- @IWhatsskill
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/pr138726-split-l-lifecycle branch from 40f129e to 8f2929d Compare September 9, 2026 15:08
roboclaw-bot and others added 2 commits September 10, 2026 11:07
Carry the reviewed media-owner guard while preserving lifecycle-layer source and history.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
Carry the corrected predecessor while preserving feature source, stable inventory, manual English resources, and race fences. Defer this layer’s managed locale/map/XML output to the normal native locale refresh.

Source-only builds retain the existing source-language fallback until generated locales are published.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Closing this PR in favor of a planned rebuild on current main.

@RomneyDa
RomneyDa deleted the openclaw/pr138726-split-l-lifecycle branch October 22, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants