Repository navigation
fix(android): pause idle gateway discovery without blocking consumers - #196209
Conversation
Worked on by: - @saariuslystoned Co-authored-by: saariuslystoned <[email protected]> OpenClaw-Publication: 213368b9-8196-4461-912c-33bac7fb1ce3
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Worked on by: - @saariuslystoned Co-authored-by: saariuslystoned <[email protected]> OpenClaw-Publication: c91763ac-0835-4a57-919f-1cf5168e9e84
|
Codex review: needs maintainer review before merge. What this changesThis PR pauses idle Android Gateway discovery while preserving recovery, visible browsing, and enabled secondary Gateway connections. Example: A connected Android user closes Settings → Gateway → Discovered and backgrounds the app.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a current Android discovery lifecycle problem and resolves the three earlier findings without a new concrete correctness defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherAndroid UI visibility, connection state, and saved Gateway selections enter NodeRuntime's discovery policy; GatewayDiscovery manages Android NSD registrations and publishes endpoints for browsing and connection recovery. flowchart TD
A[Settings and onboarding] --> B[NodeRuntime discovery policy]
C[Visibility and saved Gateways] --> B
B --> D[GatewayDiscovery]
D --> E[Android NSD]
E --> D
D --> F[Discovered endpoints]
F --> G[Connection recovery and browsing]
Technical reviewBest possible solution: Keep discovery demand in NodeRuntime and scan retirement plus endpoint rebuilding in GatewayDiscovery. Do we have a high-confidence way to reproduce the issue? Current-main source starts local NSD during GatewayDiscovery construction and provides no consumer-driven pause; the supplied earlier device report corroborates continued background scanning. Is this the best way to solve the issue? The patch uses the existing runtime and discovery owners, adds cancellable UI consumers, and preserves accepted reconnect routes without introducing another discovery manager. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9c37f5420455. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +89, Tests +128, Docs +6. Total +223 across 7 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed November 10, 2026, 7:34 PM ET / November 11, 2026, 00:34 UTC (Revision 3). |
|
Device proof for head
Base keeps browsing for gateways in the background and after it has connected. Head stops discovery in both cases. Dumps: backgrounded before / after, connected before / after. Logs: before, after; hashes in SHA256SUMS. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Worked on by: - @saariuslystoned Co-authored-by: saariuslystoned <[email protected]> OpenClaw-Publication: 15688554-a107-4e54-8104-1f80881c6a71
Co-authored-by: saariuslystoned <[email protected]>
Worked on by: - @saariuslystoned Co-authored-by: saariuslystoned <[email protected]> OpenClaw-Publication: 434ee99e-2ffc-4636-b53a-4c221a009a15
Worked on by: - @saariuslystoned Co-authored-by: saariuslystoned <[email protected]> OpenClaw-Publication: 94f1a931-6a8c-44b3-bab7-476f3583fd8e
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Co-authored-by: Solvely-Colin <[email protected]>
Keep the discovery refresh using the upstream connection state owner. Co-authored-by: Solvely-Colin <[email protected]>
|
Merged via squash.
|
* commit '7df6cb759f9e604921536a700e2f527c5516e7de': (185 commits) docs: clarify what telemetry OpenClaw sends and how to opt out refactor(ui): remove retired stream-follow test seams (#206316) fix: distinguish missing command results from unknown outcomes (#206313) fix(build): reuse stamps after identical pnpm installs (#206282) chore(ci): inventory Gateway model catalog worker lifecycles (#206251) fix: keep failed image inspections inside chat activity (#206283) fix: clarify sent-message labels and chat activity icons (#206048) fix(cron): use the service's free memory for extra automation runs (#206322) test(android): reuse the shared TLS fixture (#206280) fix(ui): restore New Session recovery during startup (#206319) test(macos): align new Gateway URL expectations (#206281) feat: let doctor --fix tell when its startup repairs have nothing to do (#206246) fix(android): pause idle gateway discovery without blocking consumers (#196209) fix(ci): prepare the Android SDK for scheduled CodeQL scans (#203843) fix(memory): read delegated cgroup pressure from the mapped leaf (#206308) improve(config): reuse plugin metadata during auto-enable (#206289) improve: copy only the selected model for agent completions (#206287) fix(pr): refresh tooling before preparing reviewed incoming PRs (#206236) fix: keep Gateway ready while plugins drain after updates (#206299) fix(crabbox): keep unused prepared mirrors reusable (#206267) ...
…openclaw#196209) Pause Android Gateway discovery when no consumer needs it, while preserving saved-Gateway recovery, visible browsing and secondary connections. Retry once on fresh rediscovery after an interrupted foreground reconnect; respect explicit Stop. Co-authored-by: Bobby Bones <[email protected]> Co-authored-by: Solvely-Colin <[email protected]> Co-authored-by: saariuslystoned <[email protected]>
What Problem This Solves
Android keeps scanning for local Gateways without an active consumer. Pausing discovery must not break background recovery, connected discovery browsing, or secondary Gateway connections.
User Impact
Android can pause idle local scans. If the first connection to a saved Gateway is interrupted before an address is accepted, returning to the app can retry when the Gateway reappears. Stop cancels that pending retry.
Why This Change Was Made
Stop idle NSD scans and retire their callbacks. Resume for a visible Discovered list or onboarding, foreground enabled secondary Gateways, and the initial saved discovered-route recovery. Rebuild local results on resume; accepted sessions retain their own reconnect address. When no address has been accepted yet, the foreground path waits for the saved Gateway's fresh address and retries once without overriding a newer Gateway action.
This preserves #104226's cold sticky-service recovery with foreground-only capabilities disabled, and #111932's foreground-only secondary operator sessions with device capabilities owned only by the focused Gateway. The refresh onto
mainkeeps discovery eligibility tied to the existing Gateway connection state instead of restoring the duplicate flag removed in #202898.Evidence
f4c26cfe, all threeGatewayDiscoveryLifecycleTestcases passed in an isolated Android Play JVM run, including reconnect on rediscovery and Stop canceling the pending retry. Kotlin lint on the conflict resolution andgit diff --checkpassed. Fresh hosted CI is separate from those local results.ccd5afacand passed with the fix one618cb5d. Hosted CI one618cb5dpassed Play, third-party, and Wear unit suites, Kotlin lint, both Android Access jobs, and the required gate. That result predates the conflict resolution.dfcb5f99.☁️ @saariuslystoned
Co-Authored-By: Bobby Bones [email protected]
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by