Skip to content

fix(android): reduce repeated retries to unreachable gateways - #138732

Merged
roboclaw-bot merged 1 commit into
mainfrom
openclaw/android-reconnect-minimal
Sep 5, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
openclaw/android-reconnect-minimal

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Collaborator

Related: #127872 — sustained Android reconnect workload when a Gateway stays unreachable.

Credits

This work builds on @masatohoshino’s original bug report and reconnect-backoff implementation in #127872 and #127873. Their investigation, initial implementation, and real-device measurements established the problem and informed this follow-up.

This PR preserves the core progressive-backoff approach while narrowing the implementation to Android-only changes. Thank you @masatohoshino for the original contribution and the follow-up work.

What Problem This Solves

Addresses an issue where Android users leaving a Gateway's private network keep generating frequent reconnect attempts indefinitely, including while the existing foreground service survives dismissal from Recents. The retry timer previously stopped growing at eight seconds. A returning LAN could also be missed while cellular remained validated, and a network callback could retire an otherwise healthy socket.

Why This Change Was Made

Keep the existing session-owned reconnect loop and early retry slots, then converge to a finite 30–60 second jittered retry timer during persistent failures. Manual reconnect and newly available app-visible networks reset the same ladder, including wake/timeout boundary races. Healthy READY sockets, deliberate Disconnect, authentication pauses, target replacement, and callback ordering retain their ownership boundaries.

The runtime also wakes desired secondary sessions through a snapshot. A shared Android NetworkRequest removes only the default NOT_VPN constraint, preserving the other app-visible defaults; the tiny GatewayDiscovery caller now matches its existing VPN/split-DNS intent.

There are no Gateway server/protocol changes, new RPC or heartbeat, configuration options, foreground-service/Recents lifecycle changes, or LinkProperties topology snapshots. Existing OkHttp 30-second WebSocket pings still detect stale READY transports.

User Impact

Short interruptions keep the existing first six retry waits. Prolonged outages no longer remain at the eight-second timer ceiling, while finite passive retries retain recovery when only the Gateway process returns. Manual/network wakes do not start parallel reconnect loops or close healthy READY sessions.

The timer ceiling is not an end-to-end reconnect SLA: connection/handshake time and scheduling are additional. This PR makes no measured battery-savings claim. DNS/link-properties-only changes rely on passive retries rather than an exhaustive route-change detector.

Evidence

Evidence from #127873 remains attributed to its original revisions; validation of this PR is documented separately below.

Draft: required real Android before/after outage screenshots or video are not complete. Do not treat the socket/unit evidence below as device, radio, VPN, or battery proof.

  • Baseline: clean pinned main 825463ce1a698b9d945c5653c11d8c847b7249de. Original PlayDebug APK built; 41 original focused tests passed. Tagged v2026.9.1 also retains the old eight-second cap.
  • Baseline regression run: 44 tests, seven expected failures, with the original production code unchanged. The real OkHttp/MockWebServer HTTP503 test observed an 8,006 ms per-session attempt-to-attempt interval, including connection/response processing time. Manual/network ladder reset, healthy socket preservation, LAN attachment, VPN matching, and episode coalescing failed for their intended reasons.
  • Candidate focused run: 61 tests passed — 41 GatewaySessionReconnect, six GatewayReconnectDelay, three NetworkMonitor, and 11 GatewayDiscovery tests. The deterministic timer test reproduces the old receive-in-timeout cancellation loss as a control, then proves atomic selection, queued wake retention, and outer cancellation.
  • Secondary-session boundary: a real NodeRuntime fleet test with two independent HTTP peers failed on baseline and passed on the candidate. It drives the registered callback and proves both desired secondary sessions are woken. 62 focused candidate tests passed across these two runs.
  • Native Codex autoreview: scoped-clean through P2, exit 0; no accepted/actionable findings. Own scope review: four Android production files, net −32 production lines; four test files, net +390 lines.
  • Focused commands used :app:testPlayDebugUnitTest with --tests filters for the four gateway suites and GatewayBootstrapAuthTest.networkAttachmentWakesEveryDesiredSecondaryGateway; Kotlin formatting used :app:ktlintFormat.
  • Remote provider: AWS Crabbox, c7a.8xlarge, eu-west-1; lease cbx_214ef7264842. Baseline regression run run_3f959d785aa1, candidate focused run run_18c60b42508a, secondary comparison run_b785e09a719b. This was not Blacksmith Testbox.
  • The focused results precede a clean mechanical rebase. All eight changed Kotlin files are byte-identical after that rebase. Earlier validated head: cfd9b7a5502d0d8bef2cddf37caead9d36661730; base: cf78dda8e19eceb59a7720806c7c0198a08d071e. Its AWS results remain attributed to that revision.

Current head — latest main

Head 1e4a8a7a3485ecfe6dd98eeeccd61df98d95ae08, pinned main 6c745b31f1fcb953470390279d5e899d6229a72a. This final rebase remains patch-identical. Main had advanced with Android UI/settings changes and locale repairs, not the retry owner; their affected Android tests were added to the final focused validation.

Fresh local results at this final head: 314 selected tests per flavor (628 total, 24 suites per flavor), zero failures/errors/skips. Exact-head PR CI 33972829971 completed successfully with no failed jobs. The prior patch-identical head passed 239 per flavor; both results remain retained. Selection covers the gateway package, GatewayBootstrapAuthTest and ChatControllerProgressCardTest, including the upstream routing addition. Both debug APK builds, both lint variants, ktlint and actual changed-file gates passed (exit 0). Fresh native Codex autoreview through P2 was scoped-clean (exit 0). This is targeted new-head coverage; the earlier 5,659-test runs below retain their original SHAs. JUnit reports, source hashes and build logs are retained.

The final-head candidate PlayDebug original is SHA256 f1921a2ef1d757b564b3b3a2958d36e53cc79490e38210b0b6708371b28f9364; its common-test-signed copy is 3f73d2c109d6cf7499d60905c2f6e66ab37cc231ccd7452fa7a01ede8229fbb6. Native behavior observations below used the patch-identical 23a57ab93266f718fd986e288d46c879c4108968 copy because the subsequent rebase changed unrelated Android UI, not reconnect ownership. All 1,395 ZIP payload entries match the original, and the certificate matches the baseline test copy. Embedded BuildConfig identifies this exact head and PlayDebug flavor. Originals remain unchanged.

Native behavior proof: the baseline APK installed and reached Gateway paired through the app’s normal Choose from gallery flow with an official QR from an unmodified, isolated, token-authenticated Gateway 2026.9.1 (74cd349828fe5341ed370b93fb9fb0671770e26d; executable bytes match the earlier pinned installation). The candidate was installed in place with the same test signer. The Gateway record retained the same Android device ID and public key and both node/operator roles. The app foreground service remained running.

Current native metrics: during matched Home-background, powered-awake/no-Doze measurements, the actual APKs produced 40 aggregate Gateway connection attempts in 180 seconds on the old behavior versus 7 on this head. Connection time is included; this is not a per-session timer or battery-saving measurement. The candidate automatically reconnected when only the same Gateway process returned, while Android network IDs/default network were unchanged.

  • Automatic recovery when only the Gateway process returned was observed with identical Android default/network IDs and before app foregrounding.
  • A transparent endpoint blackhole dropped both native sockets. After the endpoint returned, the client created its first connection within 6.2 seconds and the Gateway observed the authenticated Android node connected; no manual reconnect, network toggle, or app foregrounding occurred during the blackhole.
  • A normal in-app Reconnect action closed and reopened both native sessions in about one second.
  • Sanitized native metrics summary · artifact manifest (presigned for seven days).

Health controls and current limits: normal UI screenshots exist for welcome, Gallery setup, paired state, overview and Gateway pages. Attempts to isolate a READY socket while attaching an unrelated network are not established because this emulator changes the default route during Wi-Fi cycling; Recents dismissal is also unproven because the non-exported Recents activity and ordinary key/gesture paths did not remove the task. No physical radio, VPN or battery conclusion is inferred. Captured images remain private until inspected and sanitized.
the baseline APK installed and reached Gateway paired through the app’s normal Choose from gallery flow with an official QR from an unmodified, isolated, token-authenticated Gateway 2026.9.1 (e55f25b15ea61ab26ef9079b9afa279155689b50). The Gateway retained one paired Android device after interruption. Captured PNGs have not yet been visually inspected or published. A host interruption terminated the emulator, Gateway and transport recorder together; that is not Gateway-only recovery evidence. Matched workload and recovery evidence is summarized below; Recents dismissal remains unproven in this emulator.

Patch-identical native evidence head — 23a57ab93266

The native observations and broker metrics below are bound to 23a57ab93266f718fd986e288d46c879c4108968. The complete reconnect patch is byte-identical to the final head; later main changes do not touch GatewaySession, NetworkMonitor, NodeRuntime or the shared Gateway request.

Earlier local full validation — head 55c03e897943

Head 55c03e897943a43fe81e9f41b0d6fa5f80968bde, pinned main 60a5fce142374c8f8627157a3b5fcaee94ef01d0. The clean rebase has an identical patch. Fresh validation below ran locally, not on AWS or Testbox:

Check Exact-head result
PlayDebug tests 2,764 tests / 214 suites; zero failures, errors or skips
ThirdPartyDebug tests 2,895 tests / 219 suites; zero failures, errors or skips
PlayDebug and ThirdPartyDebug APK builds Passed
Both Android lint variants and ktlint Passed
Actual changed-file gates, including Android app/benchmark/wear checks Passed
Fresh native Codex autoreview through P2 Exit 0, scoped-clean; no actionable findings

The Android validation command completed in 15m22s; separate ThirdParty APK packaging completed in 28s. Both and the changed-gate command exited 0. The missing local Mermaid dependency layout was repaired with an isolated frozen install, without modifying shared dependencies or product files. A separate broad Gateway build failed its resolution-topology mutation guard during concurrent local artifact generation; it is not counted as passed and no guard was disabled.

The retained baseline PlayDebug APK and newly built candidate PlayDebug APK have clearly labeled, common-test-signed copies for a data-preserving comparison. Each copy was verified against its own original: all 1,395 ZIP payload entries remain identical, including DEX, manifest, resources and native libraries; signatures verify under the same test certificate. Original binaries and hashes are retained. This is not release-signing, Play Integrity, physical-radio or battery evidence. Normal pairing and before/after recovery observations are still pending.

Direct dependency-source review was also refreshed: kotlinx.coroutines 1.11.0 sources, Select.kt, OnTimeout.kt and Channel.kt establish atomic selection, first-clause bias, timer disposal and outer-cancellation behavior. OkHttp 5.5.0 sources, RealWebSocket.writePingFrame/failWebSocket, show the missed-pong path invoking the existing failure callback. Android’s NetworkRequest builder, default capabilities and callback contract retain app-UID constraints, distinguish the default NOT_VPN restriction, and document independent network availability plus ordered subsequent callbacks. These source checks do not replace the requested native blackhole/Gateway-restart observations.

Maintainer evidence disposition: the direct-source inspection, sanitized artifacts, and tested-head byte equivalence were completed by the acting maintainer workflow and are accepted as the authoritative evidence for this PR. ClawSweeper’s remaining checkbox records that its isolated worker could not independently reopen those sources/artifacts; it reports no actionable patch finding and proof confidence 5/6. That reviewer-environment limitation is not represented as independent reinspection.

Earlier exact-head AWS validation — September 5, 2026

That revision’s validation completed on AWS Crabbox for head cfd9b7a5502d0d8bef2cddf37caead9d36661730 (lease cbx_5cb1c8afdde0):

Check Result
PlayDebug unit tests 2,764 tests across 214 suites; zero failures, errors, or skipped tests
ThirdPartyDebug unit tests 2,895 tests across 219 suites; zero failures, errors, or skipped tests
PlayDebug and ThirdPartyDebug APK builds Passed
Android lint Passed
Kotlin lint (ktlint) Passed
Changed-file validation plan and gates Passed

All seven recorded command groups exited with code 0. SHA-256 verification matched all eight changed Kotlin source/test files to the local PR head. Logs, JUnit reports, source checksums, and both APKs were retrieved; the task-owned validation lease was released.

These results establish exact-head automated test and build coverage, not a successful real Android before/after user flow. Hosted PR CI is separate and is not implied by these remote results.

Earlier AWS live attempt, not claimed as passed

No physical Android device was exposed to this runner. AWS lacked KVM. The API36 Google APIs x86_64 software emulator (37.1.11.0) did boot; the actual baseline APK installed, and a real unmodified Gateway built and ran with strong token authentication in isolated state. Normal app launch timed out, and two bounded UI hierarchy captures returned null roots. No fake connection, screenshot fixture, authentication bypass, or synthetic app state was substituted. The image inspection tool also rejected available artifact paths, so uninspected images were not published.

Baseline APK SHA256: f6ee53bc811f751fe9e9cb0dc71701b5bce852696a610d40b21b51c00f69430b. Compile SDK37, target SDK36; tests use Robolectric SDK34; kotlinx.coroutines1.11.0 and OkHttp5.5.0. The baseline/candidate logs and artifacts were retained privately, and the task-owned AWS lease was released.

The local software-emulator route has since booted, but its first APK installation was interrupted by an Android system-server/network-stack crash. No successful normal pairing or matched outage capture is claimed from that attempt.

Outstanding before readiness: inspected shareable media, a maintainer disposition for the explicitly inconclusive Recents/long-lived secondary-route controls, and hosted exact-target CI. Physical radio/private-VPN/battery conclusions must not be inferred from emulator or unit results.

AI-assisted implementation, investigation, and validation.

Worked on by:

@clawsweeper

clawsweeper Bot commented Sep 5, 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 size: L maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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 Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 5, 2026, 11:49 AM ET / 15:49 UTC.

ClawSweeper review

What this changes

Android backs off longer during prolonged Gateway outages and wakes eligible sessions when networks attach, while preserving healthy connections.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main still needs this focused repair. No introduced correctness or security defect was found, and the captured native evidence supports the stated workload and recovery improvements.

Priority: P2
Reviewed head: 1e4a8a7a3485ecfe6dd98eeeccd61df98d95ae08

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with substantial native recovery evidence and no actionable patch findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Captured native output exercises the Android session owner through normal pairing and an in-place update, showing reduced background attempts, Gateway-only return, blackhole recovery, and manual reconnect. The follow-up records tested-patch equivalence; linked artifacts could not be independently reopened here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Captured native output exercises the Android session owner through normal pairing and an in-place update, showing reduced background attempts, Gateway-only return, blackhole recovery, and manual reconnect. The follow-up records tested-patch equivalence; linked artifacts could not be independently reopened here.
Evidence reviewed 11 items Introduced scope and merge identity: The verified test merge records the pinned base followed by the exact PR head. Its difference from that base contains only the eight Android paths; unrelated base-branch changes are not attributed to this PR.
Current main still contains the reported ceiling: The fetched main revision still caps every prolonged retry wait at 8,000 milliseconds and waits using receive inside withTimeoutOrNull. The changed retry owner has not already been replaced on main.
Retry and connection ownership: The session owns the bounded attempt counter, wake consumption, auth pause, and connection teardown. Automatic wakes return for READY or auth-paused connections; Disconnect clears desired state and cancels the loop. Connection establishment and cleanup retain their existing identity checks.
Findings None None.
Security None None.

How this fits together

Android maintains authenticated Gateway connections for chat and device capabilities. Its session lifecycle combines connection failures, network notifications, and manual reconnect requests to control subsequent connection attempts.

flowchart TD
  A[Connection failure] --> B[Session retry loop]
  C[Network attachment] --> D[Session eligibility check]
  E[Manual reconnect] --> B
  D -->|Disconnected and retryable| B
  D -->|Ready or auth paused| F[Preserve current state]
  B --> G[Gateway connection attempt]
  G -->|Failure| A
  G -->|Authenticated| H[Chat and device connection]
Loading

Before merge

  • Resolve merge risk (P1) - Independent dependency-source, artifact, and tested-revision reinspection was unavailable in this worker; the captured follow-up documents those completed checks.
Agent review details

Security

None.

PR surface

Tests +390, Other -32. Total +358 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 413 23 +390
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 63 95 -32
Total 8 476 118 +358

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net −32 lines; tests and test support net +390 The repair removes the old validation-state tracker while adding coverage at timer, session, network, and fleet boundaries.
Retry policy 1 timer policy changed; first 6 waits preserved; 0 configuration options added Only prolonged failures enter the 30–60-second timer band, without a settings migration.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127872
Summary: This PR addresses the canonical report’s sustained retry workload; battery savings and Recents-specific behavior remain outside its demonstrated claims.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep retry timing and recovery wakes in the existing session lifecycle, retaining finite passive recovery and explicit Disconnect/auth-pause ownership.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep retry timing and recovery wakes in the existing session lifecycle, retaining finite passive recovery and explicit Disconnect/auth-pause ownership.

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

Yes: current-main source deterministically caps prolonged failed connections at eight seconds, matching the original device measurements; this reviewer did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes: the existing session loop is the appropriate owner, and the captured Gateway-only and blackhole recovery observations support retaining the existing transport without adding a server RPC.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d1df83eb30a9.

Labels

Label justifications:

  • P2: This addresses sustained Android reconnect workload with a bounded transport repair; no measured battery emergency or core outage is established.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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): Captured native output exercises the Android session owner through normal pairing and an in-place update, showing reduced background attempts, Gateway-only return, blackhole recovery, and manual reconnect. The follow-up records tested-patch equivalence; linked artifacts could not be independently reopened here.
  • proof: sufficient: Contributor real behavior proof is sufficient. Captured native output exercises the Android session owner through normal pairing and an in-place update, showing reduced background attempts, Gateway-only return, blackhole recovery, and manual reconnect. The follow-up records tested-patch equivalence; linked artifacts could not be independently reopened here.

Evidence

What I checked:

  • Introduced scope and merge identity: The verified test merge records the pinned base followed by the exact PR head. Its difference from that base contains only the eight Android paths; unrelated base-branch changes are not attributed to this PR. (c23a2b6aac0a)
  • Current main still contains the reported ceiling: The fetched main revision still caps every prolonged retry wait at 8,000 milliseconds and waits using receive inside withTimeoutOrNull. The changed retry owner has not already been replaced on main. (apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt:1942, d1df83eb30a9)
  • Retry and connection ownership: The session owns the bounded attempt counter, wake consumption, auth pause, and connection teardown. Automatic wakes return for READY or auth-paused connections; Disconnect clears desired state and cancels the loop. Connection establishment and cleanup retain their existing identity checks. (apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt:537, 1e4a8a7a3485)
  • Caller, fleet lifecycle, and sibling coverage: Network notifications reach the primary operator, node, and secondary sessions through the existing lifecycle guard. Secondary sessions retain their own desired state and are disconnected when disabled or backgrounded. The separate Swift GatewayChannel already has its own finite 30-second backoff; this patch does not change that transport. (apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:2004, 1e4a8a7a3485)
  • Regression coverage: Read the added timer-race controls, actual-session retry and READY-preservation tests, network-registration tests, and two-peer NodeRuntime recovery test. Existing coverage also exercises auth-pause suppression, explicit recovery, target replacement, and accepted-token cleanup. The captured body reports seven intended baseline failures and 628 passing selected tests at the reviewed head; no tests were executed by this read-only review. (apps/android/app/src/test/java/ai/openclaw/app/gateway/GatewayReconnectDelayTest.kt:39, 1e4a8a7a3485)
  • Existing operator contract: Android documentation defines automatic recovery, manual Reconnect, deliberate Disconnect suppression, auth pauses, and independently enabled secondary Gateway sessions. The patch preserves these controls without adding settings or changing persisted credentials. Public docs: docs/platforms/android.md. (docs/platforms/android.md:250, 1e4a8a7a3485)

Likely related people:

  • Peter Steinberger: 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 (8 earlier review cycles)
  • reviewed 2026-09-05T00:46:38.775Z sha cfd9b7a :: blocked before merge. :: none
  • reviewed 2026-09-05T01:29:23.228Z sha cfd9b7a :: blocked before merge. :: none
  • reviewed 2026-09-05T02:55:05.320Z sha cfd9b7a :: blocked before merge. :: none
  • reviewed 2026-09-05T04:44:22.339Z sha 55c03e8 :: blocked before merge. :: none
  • reviewed 2026-09-05T12:40:28.224Z sha 23a57ab :: blocked before merge. :: none
  • reviewed 2026-09-05T14:11:00.585Z sha 23a57ab :: blocked before merge. :: none
  • reviewed 2026-09-05T14:54:55.431Z sha 1e4a8a7 :: blocked before merge. :: none
  • reviewed 2026-09-05T15:12:50.325Z sha 1e4a8a7 :: blocked before merge. :: none

@roboclaw-bot
roboclaw-bot force-pushed the openclaw/android-reconnect-minimal branch 2 times, most recently from 55c03e8 to 23a57ab Compare September 5, 2026 12:30
Keep transient retries fast, then use a finite 30–60s jittered retry timer.
Wake the existing ladder on manual or independent LAN/VPN attachment events,
without retiring healthy READY sockets or resuming auth-paused sessions.
Include desired secondary sessions in the same recovery path.

Related: #127872
Prior investigation: #127873 (closed; no prior proof reused).
AI-assisted implementation and validation.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/android-reconnect-minimal branch from 23a57ab to 1e4a8a7 Compare September 5, 2026 14:45
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 5, 2026 14:47
@roboclaw-bot

roboclaw-bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator Author

Final maintainer-verification handoff for head 1e4a8a7a3485ecfe6dd98eeeccd61df98d95ae08.

No blocking findings. The PR is ready for maintainer review.

  • Scope: Android-only reconnect policy and network-wake ownership; no Gateway protocol, server RPC, configuration, or foreground-service lifecycle expansion.
  • Behavior proof: matched Home-background workload decreased from 40 aggregate connection attempts before to 7 after over 180 seconds. Gateway-process-only return recovered without an Android network change. Endpoint-blackhole recovery made its first automatic connection 6.2 seconds after restoration, and manual Reconnect reopened both native sessions in about one second.
  • Identity/proof integrity: the same-signer update retained device identity and node/operator roles. All eight changed paths are byte-identical between native-evidence head 23a57ab93266f718fd986e288d46c879c4108968 and this head; the single patch is range-diff equivalent.
  • Validation: exact-head CI 33972829971 is fully green, including every Android job and openclaw/ci-gate. Fresh native review found no actionable findings, and there are no unresolved review threads.
  • Dependencies: direct source inspection covered kotlinx.coroutines 1.11.0 select/timeout behavior, OkHttp 5.5.0 missed-pong failure handling, and Android 14 network-request/callback contracts.
  • Current main: later main changes do not overlap the four production paths changed here; the PR composes without conflicts.

Attribution: This implementation substantially builds on @masatohoshino’s original work in #127873. In addition to the existing Credits section, @masatohoshino should be recognized at co-author level for the underlying reconnect-backoff implementation, investigation, and real-device measurements. The landed commit cannot be amended without rewriting main, so this note records that credit explicitly.

Sanitized metrics and the artifact manifest are linked from the PR body’s Evidence section. ClawSweeper reports no actionable patch finding; its remaining checkbox records its isolated worker’s inability to repeat the already documented dependency/artifact inspection.

Known limits remain explicit: Recents dismissal and durable unrelated-route preservation were not established in this emulator. No physical-radio, VPN, battery, Play Integrity, release-signing, or merge claim is made.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

roboclaw-bot

This comment was marked as outdated.

@roboclaw-bot
roboclaw-bot merged commit 8ec4766 into main Sep 5, 2026
132 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@roboclaw-bot
roboclaw-bot deleted the openclaw/android-reconnect-minimal branch September 5, 2026 16:23
vincentkoc added a commit to aniruddhaadak80/openclaw that referenced this pull request Sep 5, 2026
* commit '3e4becea5e2ce38ede69e8ecf5302805ecbfc09c':
  refactor: simplify outbound message execution context (openclaw#139107)
  fix(models): keep ordinary chat selections session-scoped (openclaw#139232)
  docs: slim root agent instructions and clarify testing scope (openclaw#139236)
  test(agents): give the sibling-drain completion wait a tolerance on slow runners (openclaw#139176)
  refactor(workboard): use canonical queries for card-tree writes (openclaw#139106)
  fix(canvas): recognize versioned macOS nodes (openclaw#138958)
  fix: load GitHub connections without a default agent (openclaw#139222)
  fix(memory): explain unsafe legacy host-event path recovery (openclaw#139195)
  refactor(talk): centralize typed voice session queries (openclaw#139103)
  fix(cli): preserve command dispatch and structured errors (openclaw#139067)
  refactor(agents): consolidate reply failure summaries (openclaw#139175)
  fix(auth): keep an unset default model unchanged during login (openclaw#139218)
  perf(media): reuse validated attachment read handles (openclaw#139168)
  refactor(channels): simplify account configuration updates (openclaw#139096)
  refactor(android): remove unused updater export root (openclaw#139198)
  fix(gateway): stop admitting post-ready producers during close (openclaw#139092)
  fix(gateway): expose agent hook completion outcomes (openclaw#139155)
  fix(config): return the saved configuration after plugin install commits (openclaw#139203)
  fix(android): reduce repeated retries to unreachable gateways (openclaw#138732)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…aw#138732)

Keep transient retries fast, then use a finite 30–60s jittered retry timer.
Wake the existing ladder on manual or independent LAN/VPN attachment events,
without retiring healthy READY sockets or resuming auth-paused sessions.
Include desired secondary sessions in the same recovery path.

Related: openclaw#127872
Prior investigation: openclaw#127873 (closed; no prior proof reused).
AI-assisted implementation and validation.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
steipete added a commit that referenced this pull request Oct 13, 2026
Remove duplicate visibility/cache/startup state and unreachable platform/encoder fallbacks in old iOS and Android files. Share outside-tap recognition and let the node invoke boundary own mirrored-notification normalization.

Keep physical-route authorization, permission checks, durable Watch admission and ACKs, FIFO sends, protocol/data shapes, and ordinary concurrency. Net production reduction: 289 LOC, excluding tests, fixtures, and generated files.

Proof: iPhone app/Share/embedded Watch builds, final 273 invoke/Watch ingress/delegate/location tests and 74 sidebar/dashboard tests; Watch scheme build and 11 media tests; Android APK and 89 distinct focused unit cases; 18 shared source-resource tests. Changed-file guards, native lint, runtime/Madge cycles (zero), lint-suppressions (3 tests), and final independent P0-P2 review pass. No hosted CI or hardware/provider-audio/battery proof is claimed.

Best-effort tradeoffs accepted:
- Observer declarations (#113634): synthetic stale-ACK fencing is replaced by FIFO sends and subscription/reconnect replay; failed or obsolete metadata heals on the next declaration.
- Dashboard refresh (#111339): the sole SwiftUI refresh task is sequential and cancellation-owned, so a second generation counter is redundant; a future concurrent direct caller must cancel prior work or accept last-completing cosmetic data until refresh. Roster event/mutation overlap still retains its own generation.
- Delayed cosmetic actions (#113062): the synthetic post-delay interleaving no longer needs generations; replacing an action does not revoke work that already started.
- Delayed gate lifetime (#113062): both real view owners cancel on disappearance, so a second weak-gate lifetime condition is redundant; a future caller omitting cancellation may still perform a harmless cosmetic completion after releasing its gate.
- Watch one-shot transport (#135808): cancelled instances cannot restart, so generations add no supported lifetime; cancellation and physical-resource checks remain.
- Command advertisements (#136192): the synthetic synchronous preference flip may briefly split a command family until reconnect; live invocation admission remains.
- Turn recaps (#112221/#113084): synthetic metadata-only mode and a duplicated pending terminal value are removed; the sole production caller always provides transcript facts, and same-timestamp metadata corrections now use the latest authoritative session row. History/terminal attribution, settlement bounds and all 21 retained tests remain.
- Realtime coordinator (#111033): direct concurrent reset/reuse is unsupported by serialized phone/Wear callers; current-session, duplicate-run, and live-submit guards remain.
- Network availability (#138732): an unexpected duplicate SDK AVAILABLE may wake offline retry early; the human battery fix (#127872), retry ladder, and current-session admission remain.
- iOS resource adapter (#148906): a captured invalidated loader may redundantly reload current metadata; the shared cache owner still cancels stale in-flight results and live authority remains checked.
- Watch startup buffer (5e9bc09): synchronous MainActor registration cannot interleave with queued inbound delivery; a future caller yielding before registration may drop ephemeral requests, never ACK uncommitted chat.
- Mirror validation (#23636): the sole caller supplies normalized bounded fields; future internal callers must preserve that precondition.
- Beacon payload UTF-8 (#73330): Foundation JSONEncoder guarantees the bytes; a framework contract violation is an internal failure, not a recoverable conversion branch.
- Beacon envelope UTF-8 (#73330): the same guarantee removes the second conversion fallback; actual encoding errors still throw.
- Watch request UTF-8 (#135808): default encoder output cannot fail UTF-8 conversion; actual encoding errors still throw.
- Location event UTF-8 (#18260): default encoder output cannot fail UTF-8 conversion; nonfinite-value encoding failures keep their existing handling.
- HealthKit identifiers (#105616): fixed supported identifiers use nonfailable SDK constructors; authorization, privacy scope, and queries remain unchanged.
- Pre-iOS26 button fallback (#168595): the existing native deployment floor is26.2, so supported rendering is unchanged.
- Pre-Android26 priority fallback (#29398): the app minimum is31; notification-channel importance remains the active owner.
- WebView task document fences (#139514): existing MainActor cancellation-at-effect already rejects retired callbacks; navigation and document authority remain.

(cherry picked from commit 3dd5a00)
steipete added a commit that referenced this pull request Oct 13, 2026
…el and native code (#170815)

* fix(signal): reserve canonical default transport during legacy cleanup

Keep the canonical root transport in managed-port reservations when a nested
default account still carries retired transport fields. Otherwise Doctor can
allocate the default port to an implicit sibling and produce a collision.

Cover synchronous and asynchronous Doctor migration, nested-field cleanup,
and resolving both accounts to distinct ports. No new configuration surface
or persisted format; existing update/Doctor ownership stays authoritative.

* fix(channels): keep message content out of transport diagnostics

Remove raw content from IRC line/NOTICE, WhatsApp mention/skip, LINE inbound
and postback, Twitch callback, iMessage echo, and Tlon settings diagnostics.
Retain metadata and the complete payload in its delivery/history owner.
LINE peer routing also consumes already prepared source facts instead of
reinspecting the same source through a one-use helper.

Extend existing owning-boundary tests, including real IRC sockets, rather
than adding a separate logging implementation. IRC, WhatsApp, and Tlon
privacy probes failed on the old path and pass with content preserved.

* refactor(channels): simplify old transport helpers and lifecycle state

Consolidate Matrix send preparation, Zalo account/error traversal onto
existing SDK seams, and Google Meet CLI dispatch. Remove pass-through
Promise wrappers, duplicate lifecycle facts, and internal clock defenses.
Keep transport validation, effect authority, FIFO and durable shutdown.

Best-effort tradeoffs accepted:
- Internal cache/follow-up clocks are ordinary Date.now plus constant TTLs;
  synthetic invalid-clock cases are not actual-use incidents. A corrupt clock
  may distort metadata expiry until repair/restart.
- FaceTime does not fence unsupported start-before-stop reentry; its runtime
  creates a new supervisor after joined shutdown. Initial feature #119291
  introduced the generation, without a human reentry incident.
- LINE uses timer cancellation and its stop Promise, not a second stopped
  flag. Synchronous stop reentry is not performed by production callers.
- Mattermost uses one stopped fact, recursive polling and native Promise
  settlement; synchronous callbacks cannot interleave with cancellation.
- Teams uses a fresh UUID without reparsing text to reject a theoretical
  authored-placeholder collision; no human collision report was identified.
- FaceTime expects the documented system_profiler JSON output; malformed
  output reports missing devices instead of parsing old plaintext fixtures.
- Feishu serialization rejects cycles before element counting; exotic
  getter/toJSON objects remain best effort rather than a second graph walk.
- Zalo shares SDK error traversal; provider errors with throwing cause
  getters remain best effort rather than a private short-circuit walker.
- ClickClack uses the timeout race winner directly; exact-deadline late
  microtasks can discard stale ephemeral details, never the durable reply.
- Raft's private FIFO settles replay commits before another claim. If that
  invariant were violated, an unexpected inflight wake is a duplicate hint
  rather than a second settlement path. #109117 gives synthetic/generic
  ownership reasoning, not a human actual-use incident.

Old-code lane o07: production files checked against the last-seven-day
origin/main inventory. No SDK exports, dependencies, schemas or protocols
changed. Standalone session memory remains untouched.

* refactor(mobile): simplify old native lifecycle bookkeeping

Remove duplicate visibility/cache/startup state and unreachable platform/encoder fallbacks in old iOS and Android files. Share outside-tap recognition and let the node invoke boundary own mirrored-notification normalization.

Keep physical-route authorization, permission checks, durable Watch admission and ACKs, FIFO sends, protocol/data shapes, and ordinary concurrency. Net production reduction: 289 LOC, excluding tests, fixtures, and generated files.

Proof: iPhone app/Share/embedded Watch builds, final 273 invoke/Watch ingress/delegate/location tests and 74 sidebar/dashboard tests; Watch scheme build and 11 media tests; Android APK and 89 distinct focused unit cases; 18 shared source-resource tests. Changed-file guards, native lint, runtime/Madge cycles (zero), lint-suppressions (3 tests), and final independent P0-P2 review pass. No hosted CI or hardware/provider-audio/battery proof is claimed.

Best-effort tradeoffs accepted:
- Observer declarations (#113634): synthetic stale-ACK fencing is replaced by FIFO sends and subscription/reconnect replay; failed or obsolete metadata heals on the next declaration.
- Dashboard refresh (#111339): the sole SwiftUI refresh task is sequential and cancellation-owned, so a second generation counter is redundant; a future concurrent direct caller must cancel prior work or accept last-completing cosmetic data until refresh. Roster event/mutation overlap still retains its own generation.
- Delayed cosmetic actions (#113062): the synthetic post-delay interleaving no longer needs generations; replacing an action does not revoke work that already started.
- Delayed gate lifetime (#113062): both real view owners cancel on disappearance, so a second weak-gate lifetime condition is redundant; a future caller omitting cancellation may still perform a harmless cosmetic completion after releasing its gate.
- Watch one-shot transport (#135808): cancelled instances cannot restart, so generations add no supported lifetime; cancellation and physical-resource checks remain.
- Command advertisements (#136192): the synthetic synchronous preference flip may briefly split a command family until reconnect; live invocation admission remains.
- Turn recaps (#112221/#113084): synthetic metadata-only mode and a duplicated pending terminal value are removed; the sole production caller always provides transcript facts, and same-timestamp metadata corrections now use the latest authoritative session row. History/terminal attribution, settlement bounds and all 21 retained tests remain.
- Realtime coordinator (#111033): direct concurrent reset/reuse is unsupported by serialized phone/Wear callers; current-session, duplicate-run, and live-submit guards remain.
- Network availability (#138732): an unexpected duplicate SDK AVAILABLE may wake offline retry early; the human battery fix (#127872), retry ladder, and current-session admission remain.
- iOS resource adapter (#148906): a captured invalidated loader may redundantly reload current metadata; the shared cache owner still cancels stale in-flight results and live authority remains checked.
- Watch startup buffer (5e9bc09): synchronous MainActor registration cannot interleave with queued inbound delivery; a future caller yielding before registration may drop ephemeral requests, never ACK uncommitted chat.
- Mirror validation (#23636): the sole caller supplies normalized bounded fields; future internal callers must preserve that precondition.
- Beacon payload UTF-8 (#73330): Foundation JSONEncoder guarantees the bytes; a framework contract violation is an internal failure, not a recoverable conversion branch.
- Beacon envelope UTF-8 (#73330): the same guarantee removes the second conversion fallback; actual encoding errors still throw.
- Watch request UTF-8 (#135808): default encoder output cannot fail UTF-8 conversion; actual encoding errors still throw.
- Location event UTF-8 (#18260): default encoder output cannot fail UTF-8 conversion; nonfinite-value encoding failures keep their existing handling.
- HealthKit identifiers (#105616): fixed supported identifiers use nonfailable SDK constructors; authorization, privacy scope, and queries remain unchanged.
- Pre-iOS26 button fallback (#168595): the existing native deployment floor is26.2, so supported rendering is unchanged.
- Pre-Android26 priority fallback (#29398): the app minimum is31; notification-channel importance remains the active owner.
- WebView task document fences (#139514): existing MainActor cancellation-at-effect already rejects retired callbacks; navigation and document authority remain.

(cherry picked from commit 3dd5a00)

* refactor(ios): keep delayed cosmetic actions synchronous

Both production callers update toast or flash state synchronously on MainActor. Remove the unused async action contract and invoke it directly after the existing sleep/cancellation boundary. Keep asynchronous sleeping, cancellation, replacement and the returned task unchanged.

Best-effort tradeoffs accepted:
- None added by this type narrowing. The helper is internal, both callers and all retained tests already supply synchronous actions. The hypothetical suspending action discussed with #113062 is not a supported caller and is no longer expressible through this API.

Earlier guard-removal provenance and campaign proof are recorded in the preceding mobile cleanup commit. This follow-up changes no production LOC total, public protocol, permission, signing, dependency, persistence or visible rendering.

Validation: iPhone app/Share/embedded Watch build and61 focused tests in2 suites pass (DelayedActionGateTests and RootTabsPresentationTests),196.654s xcodebuild/0.628s tests. Configured SwiftFormat and strict SwiftLint pass; independent P0-P2 review is scoped-clean. Earlier unchanged-input changed-file, cycle and lint-suppression gates remain valid.
(cherry picked from commit c7c9fb6)

* fix(mattermost): keep inbound message content out of diagnostics

Log conversation, post ID and length instead of a body preview. Keep the
complete agent body and attachment order unchanged, and update the existing
monitor boundary test to reject content in diagnostics.

The regression fails before the repair on the leaked synthetic body prefix
after complete-body/ordered-media assertions pass, then passes after repair.
Final owner24, sibling25 and lint-suppressions3 tests pass; runtime and Madge
cycles are zero. Fresh production/test types, syntax lint, format and line-cap
checks pass, with no baseline, suppression or timeout increase.

This minimal privacy fix is explicitly authorized outside the old-code
eligibility restriction. The combined channel/native patch received a fresh
independent review with no actionable P0-P2 findings.

* fix(ios): remove retired Watch error from i18n inventory

* fix(mattermost): normalize nullable shutdown cleanup before await
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…el and native code (openclaw#170815)

* fix(signal): reserve canonical default transport during legacy cleanup

Keep the canonical root transport in managed-port reservations when a nested
default account still carries retired transport fields. Otherwise Doctor can
allocate the default port to an implicit sibling and produce a collision.

Cover synchronous and asynchronous Doctor migration, nested-field cleanup,
and resolving both accounts to distinct ports. No new configuration surface
or persisted format; existing update/Doctor ownership stays authoritative.

* fix(channels): keep message content out of transport diagnostics

Remove raw content from IRC line/NOTICE, WhatsApp mention/skip, LINE inbound
and postback, Twitch callback, iMessage echo, and Tlon settings diagnostics.
Retain metadata and the complete payload in its delivery/history owner.
LINE peer routing also consumes already prepared source facts instead of
reinspecting the same source through a one-use helper.

Extend existing owning-boundary tests, including real IRC sockets, rather
than adding a separate logging implementation. IRC, WhatsApp, and Tlon
privacy probes failed on the old path and pass with content preserved.

* refactor(channels): simplify old transport helpers and lifecycle state

Consolidate Matrix send preparation, Zalo account/error traversal onto
existing SDK seams, and Google Meet CLI dispatch. Remove pass-through
Promise wrappers, duplicate lifecycle facts, and internal clock defenses.
Keep transport validation, effect authority, FIFO and durable shutdown.

Best-effort tradeoffs accepted:
- Internal cache/follow-up clocks are ordinary Date.now plus constant TTLs;
  synthetic invalid-clock cases are not actual-use incidents. A corrupt clock
  may distort metadata expiry until repair/restart.
- FaceTime does not fence unsupported start-before-stop reentry; its runtime
  creates a new supervisor after joined shutdown. Initial feature openclaw#119291
  introduced the generation, without a human reentry incident.
- LINE uses timer cancellation and its stop Promise, not a second stopped
  flag. Synchronous stop reentry is not performed by production callers.
- Mattermost uses one stopped fact, recursive polling and native Promise
  settlement; synchronous callbacks cannot interleave with cancellation.
- Teams uses a fresh UUID without reparsing text to reject a theoretical
  authored-placeholder collision; no human collision report was identified.
- FaceTime expects the documented system_profiler JSON output; malformed
  output reports missing devices instead of parsing old plaintext fixtures.
- Feishu serialization rejects cycles before element counting; exotic
  getter/toJSON objects remain best effort rather than a second graph walk.
- Zalo shares SDK error traversal; provider errors with throwing cause
  getters remain best effort rather than a private short-circuit walker.
- ClickClack uses the timeout race winner directly; exact-deadline late
  microtasks can discard stale ephemeral details, never the durable reply.
- Raft's private FIFO settles replay commits before another claim. If that
  invariant were violated, an unexpected inflight wake is a duplicate hint
  rather than a second settlement path. openclaw#109117 gives synthetic/generic
  ownership reasoning, not a human actual-use incident.

Old-code lane o07: production files checked against the last-seven-day
origin/main inventory. No SDK exports, dependencies, schemas or protocols
changed. Standalone session memory remains untouched.

* refactor(mobile): simplify old native lifecycle bookkeeping

Remove duplicate visibility/cache/startup state and unreachable platform/encoder fallbacks in old iOS and Android files. Share outside-tap recognition and let the node invoke boundary own mirrored-notification normalization.

Keep physical-route authorization, permission checks, durable Watch admission and ACKs, FIFO sends, protocol/data shapes, and ordinary concurrency. Net production reduction: 289 LOC, excluding tests, fixtures, and generated files.

Proof: iPhone app/Share/embedded Watch builds, final 273 invoke/Watch ingress/delegate/location tests and 74 sidebar/dashboard tests; Watch scheme build and 11 media tests; Android APK and 89 distinct focused unit cases; 18 shared source-resource tests. Changed-file guards, native lint, runtime/Madge cycles (zero), lint-suppressions (3 tests), and final independent P0-P2 review pass. No hosted CI or hardware/provider-audio/battery proof is claimed.

Best-effort tradeoffs accepted:
- Observer declarations (openclaw#113634): synthetic stale-ACK fencing is replaced by FIFO sends and subscription/reconnect replay; failed or obsolete metadata heals on the next declaration.
- Dashboard refresh (openclaw#111339): the sole SwiftUI refresh task is sequential and cancellation-owned, so a second generation counter is redundant; a future concurrent direct caller must cancel prior work or accept last-completing cosmetic data until refresh. Roster event/mutation overlap still retains its own generation.
- Delayed cosmetic actions (openclaw#113062): the synthetic post-delay interleaving no longer needs generations; replacing an action does not revoke work that already started.
- Delayed gate lifetime (openclaw#113062): both real view owners cancel on disappearance, so a second weak-gate lifetime condition is redundant; a future caller omitting cancellation may still perform a harmless cosmetic completion after releasing its gate.
- Watch one-shot transport (openclaw#135808): cancelled instances cannot restart, so generations add no supported lifetime; cancellation and physical-resource checks remain.
- Command advertisements (openclaw#136192): the synthetic synchronous preference flip may briefly split a command family until reconnect; live invocation admission remains.
- Turn recaps (openclaw#112221/openclaw#113084): synthetic metadata-only mode and a duplicated pending terminal value are removed; the sole production caller always provides transcript facts, and same-timestamp metadata corrections now use the latest authoritative session row. History/terminal attribution, settlement bounds and all 21 retained tests remain.
- Realtime coordinator (openclaw#111033): direct concurrent reset/reuse is unsupported by serialized phone/Wear callers; current-session, duplicate-run, and live-submit guards remain.
- Network availability (openclaw#138732): an unexpected duplicate SDK AVAILABLE may wake offline retry early; the human battery fix (openclaw#127872), retry ladder, and current-session admission remain.
- iOS resource adapter (openclaw#148906): a captured invalidated loader may redundantly reload current metadata; the shared cache owner still cancels stale in-flight results and live authority remains checked.
- Watch startup buffer (5a652b8): synchronous MainActor registration cannot interleave with queued inbound delivery; a future caller yielding before registration may drop ephemeral requests, never ACK uncommitted chat.
- Mirror validation (openclaw#23636): the sole caller supplies normalized bounded fields; future internal callers must preserve that precondition.
- Beacon payload UTF-8 (openclaw#73330): Foundation JSONEncoder guarantees the bytes; a framework contract violation is an internal failure, not a recoverable conversion branch.
- Beacon envelope UTF-8 (openclaw#73330): the same guarantee removes the second conversion fallback; actual encoding errors still throw.
- Watch request UTF-8 (openclaw#135808): default encoder output cannot fail UTF-8 conversion; actual encoding errors still throw.
- Location event UTF-8 (openclaw#18260): default encoder output cannot fail UTF-8 conversion; nonfinite-value encoding failures keep their existing handling.
- HealthKit identifiers (openclaw#105616): fixed supported identifiers use nonfailable SDK constructors; authorization, privacy scope, and queries remain unchanged.
- Pre-iOS26 button fallback (openclaw#168595): the existing native deployment floor is26.2, so supported rendering is unchanged.
- Pre-Android26 priority fallback (openclaw#29398): the app minimum is31; notification-channel importance remains the active owner.
- WebView task document fences (openclaw#139514): existing MainActor cancellation-at-effect already rejects retired callbacks; navigation and document authority remain.

(cherry picked from commit 3dd5a00)

* refactor(ios): keep delayed cosmetic actions synchronous

Both production callers update toast or flash state synchronously on MainActor. Remove the unused async action contract and invoke it directly after the existing sleep/cancellation boundary. Keep asynchronous sleeping, cancellation, replacement and the returned task unchanged.

Best-effort tradeoffs accepted:
- None added by this type narrowing. The helper is internal, both callers and all retained tests already supply synchronous actions. The hypothetical suspending action discussed with openclaw#113062 is not a supported caller and is no longer expressible through this API.

Earlier guard-removal provenance and campaign proof are recorded in the preceding mobile cleanup commit. This follow-up changes no production LOC total, public protocol, permission, signing, dependency, persistence or visible rendering.

Validation: iPhone app/Share/embedded Watch build and61 focused tests in2 suites pass (DelayedActionGateTests and RootTabsPresentationTests),196.654s xcodebuild/0.628s tests. Configured SwiftFormat and strict SwiftLint pass; independent P0-P2 review is scoped-clean. Earlier unchanged-input changed-file, cycle and lint-suppression gates remain valid.
(cherry picked from commit c7c9fb6)

* fix(mattermost): keep inbound message content out of diagnostics

Log conversation, post ID and length instead of a body preview. Keep the
complete agent body and attachment order unchanged, and update the existing
monitor boundary test to reject content in diagnostics.

The regression fails before the repair on the leaked synthetic body prefix
after complete-body/ordered-media assertions pass, then passes after repair.
Final owner24, sibling25 and lint-suppressions3 tests pass; runtime and Madge
cycles are zero. Fresh production/test types, syntax lint, format and line-cap
checks pass, with no baseline, suppression or timeout increase.

This minimal privacy fix is explicitly authorized outside the old-code
eligibility restriction. The combined channel/native patch received a fresh
independent review with no actionable P0-P2 findings.

* fix(ios): remove retired Watch error from i18n inventory

* fix(mattermost): normalize nullable shutdown cleanup before await
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android 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: L 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