feat(android): reconnect gateway when validated network returns#100347
Conversation
9c78f95 to
bd19196
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 1:54 AM ET / 05:54 UTC. Summary PR surface: Docs +2, Other +199. Total +201 across 6 files. Reproducibility: not applicable. as a strict bug reproduction because this PR adds a new immediate reconnect trigger rather than fixing a documented current contract. Source inspection confirms current main only reconnects from foreground/backoff paths, and the PR body includes emulator live output for airplane-mode restoration. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the current branch after exact-head maintainer review if Android owners accept validated-network callbacks as a wake signal; otherwise require one more device, VPN, or diagnostic-log proof path before merge. Do we have a high-confidence way to reproduce the issue? Not applicable as a strict bug reproduction because this PR adds a new immediate reconnect trigger rather than fixing a documented current contract. Source inspection confirms current main only reconnects from foreground/backoff paths, and the PR body includes emulator live output for airplane-mode restoration. Is this the best way to solve the issue? Yes, if maintainers accept the platform timing tradeoff. Routing the wake through GatewaySession keeps desired-connection and auth-pause decisions in the existing owner instead of adding a parallel reconnect loop. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae4a1e236f7e. Label changesLabel justifications:
Evidence reviewedPR surface: Docs +2, Other +199. Total +201 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
0def6f0 to
3927215
Compare
3927215 to
bf37f31
Compare
|
Land-ready maintainer rewrite completed.
Proof for final head
The source-blind exact-head emulator probes remain an explicit gap; the contributor's real airplane-mode proof predates the rewrite, while the rewritten timing and suppression branches are covered by source-aware review plus exact-head unit/build proof. |
Co-authored-by: Cursor <[email protected]>
bf37f31 to
0bdf7e3
Compare
…claw#100347) * feat(android): reconnect gateway when validated network returns Co-authored-by: Cursor <[email protected]> * fix(android): dedupe validated network reconnects * fix(android): wake gateway reconnect backoff safely * fix(android): close network monitor startup race * chore(android): refresh native i18n inventory --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…claw#100347) * feat(android): reconnect gateway when validated network returns Co-authored-by: Cursor <[email protected]> * fix(android): dedupe validated network reconnects * fix(android): wake gateway reconnect backoff safely * fix(android): close network monitor startup race * chore(android): refresh native i18n inventory --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
When Android lost and regained network connectivity, OpenClaw could remain disconnected from the gateway until the app foregrounded or the current
GatewaySessionbackoff elapsed. That left node/operator sessions offline longer than necessary after Wi-Fi or cellular recovery.Why This Change Was Made
Android now tracks validated networks and wakes existing desired gateway sessions only when the validated-network set moves from empty to non-empty.
The maintainer rewrite keeps each responsibility at its owner:
NetworkMonitorconsumes the orderedonCapabilitiesChangedcallback and only reports a validated offline-to-online transition. It does not synchronously query capabilities fromonAvailable; Android documents that pattern as race-prone.GatewaySessionowns a conflated wake signal for its single reconnect loop, so restoration actually interrupts an active delay without creating a parallel loop.No permission, config, migration, protocol, dependency, or command surface is added. The existing
ACCESS_NETWORK_STATEpermission is reused.User Impact
After all validated networks disappear and one returns, Android retries saved gateway sessions immediately instead of waiting for the current backoff slot. Routine capability churn, partial network loss, captive/unvalidated networks, explicit disconnects, and deliberate authentication pauses do not trigger a retry.
Evidence
Final rewritten head:
0bdf7e34a542220b813587bb95ac49848dbc5f32.cbx_1fdce258694b, runrun_91884324b24a: bootstrap verified rewritten headbf37f31e61aa1d266d5f9f8efc5c5cdd0740b842, no IAM credentials endpoint, public networking with no Tailscale, pinned Node/pnpm, and isolated HOME;testThirdPartyDebugUnitTest,testPlayDebugUnitTest, andassemblePlayDebugpassed (82 tasks, Gradle 2m51s). The final head is the same reviewed implementation cleanly rebased over currentmain, plus regenerated native i18n inventory.28771116526and Workflow Sanity28771116539: passed.node --import tsx scripts/native-app-i18n.ts check: passed.git diff --check: passed.Contributor real-emulator proof used airplane mode against a local mock WebSocket gateway:
Source-blind limitation: no interactive emulator was available for the exact maintainer rewrite, so exact timing, per-session attribution, auth-pause, captive-portal, multi-network, and explicit-disconnect probes remain unclaimed. Those branches have source-aware state coverage, full Android unit/build proof, and maintainer review.
AI-assisted: yes. The contributor implementation was reviewed and substantially rewritten by a maintainer agent, then independently autoreviewed and remotely validated.