Skip to content

feat(android): sign in to Gateway profiles through Cloudflare Access - #147307

Draft
vincentkoc wants to merge 15 commits into
fix/android-markdown-source-spans-20260914from
feat/android-cloudflare-access-runtime-20260913
Draft

vincentkoc wants to merge 15 commits into
fix/android-markdown-source-spans-20260914from
feat/android-cloudflare-access-runtime-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

An Android Gateway behind Cloudflare Access needs browser sign-in before native node, operator, chat, and media connections can proceed.

User Impact

Manual, discovered, and QR connections resume their original target after Custom Tabs sign-in. Expired setup deadlines request a fresh scan. Sign out/account replacement retire matching managed consumers. Forget drains/removes the selected profile and intentionally clears its pairing/headers while preserving other profiles; final-owner removal retires the shared grant. Ordinary service-header connections remain independent; IdP logout is not implied.

Why This Change Was Made

Carry one admission checkpoint through queues, TLS trust, configuration, resets, and browser handoff. Primary and secondary consumers use captured authorization; one presentation snapshot drives visible outcomes.

The immediate prerequisite is #147877 (fix/android-markdown-source-spans-20260914) (aa784f04a5be476315ef312bb6aa11337742bcf4), above the Access owner #147305 and transport #147094. It removes unused chat Markdown metadata after repeated large-message CI allocation failures. The latest app-only correction makes the permission refresh test wait for a new connection identity before inspecting its options. It uses the existing helper and preserves runtime behavior, assertions, and deadlines.

The rebuilt ingress controller keeps activation restacking deferred until the held-input boundary is resolved. Preserve this activation head/base and the existing executor; do not start a competing reconstruction. Later activation run 35824941752 skipped all 32 jobs, and controller run 35825063432 skipped all 31, so neither supplies new qualification.

Evidence

Signed head 1a8126346f43bfcb387e4b52dc6a6876eaba8a7b, immediate base aa784f04a5be476315ef312bb6aa11337742bcf4. CI 34832107763, attempt 1 tested 1cfcc7b84f149da25ad8ea86e803fcdad0836635, whose ordered parents are that base and head; tree dccf6534a2d20d262361470017b35d4e2dfae70b equals the published source tree. The stack includes the existing Play/lint budget prerequisite at 47cc409e0ef5ca578d9cb3d1017d8de9f53422bf. All eight Android jobs passed.

Play tests and lint passed 3,327 tests: 3,317 app and 10 Wear-shared. Third-party tests and lint passed 3,448. Both flavors had zero failures, errors or skips, including all 99 bootstrap, 51 ingress-owner and two wire tests. The new cold Sign-out order/entry scenarios, unchanged held-TLS Sign-out/fresh-Retry Runtime regression, and trust/ordinary/Stop/permission/direct-switch controls passed. Both complete phone test-and-lint stages finished; the earlier Play lint-cancellation gap is closed. Inspected reports: Play, SHA-256 f742b9dc46c58a89139068b7850f23029763ac243f64e843a50176e395c95e69; third-party, SHA-256 0a5cb3a86fe8e0a98d2b3582cbf15c0625502b24c815c74607237c560b1b5b86.

All four native cells passed ten invocations with zero skips. Debug 4K and 16K each ran two original cases plus seed and verifier. Release 4K and 16K each passed the minified binding case. Debug receipts establish distinct processes 5517→5556 and 9151→9191, seed-process exit, unchanged installation/storage/source/nonce, original expiry, acknowledged raw grant absence and preserved profile/pairing/header controls. Actual R8, four-ABI packaging and strict 16K alignment passed. Inspected native artifacts: Debug 4K, Debug 16K, Release 4K, Release 16K.

Wear tests and lint passed 284 tests with zero failures, errors or skips; reports, SHA-256 67df0ea2b9bc72cb759983de36ccbbdec5c303cf8d30087d0115cfbbfb37f69d. Ktlint passed.

Overall CI is not green. Complete job metadata for run 34832107763 also shows UI E2E shard 1/7 failed, with cause not established here, and the aggregate gate failed. The separate Docker-helper assertion expects the retired kitchen-sink fixture while the inherited baseline selects plugin-e2e-fixture (355 other tests passed). Existing follow-ups are 148129 and 148118; neither is included or endorsed by this PR.

ClawSweeper Revision 18, completed September 23 at 06:21 UTC, reviews exact head 1a8126346f43bfcb387e4b52dc6a6876eaba8a7b and remains blocked/needs-human. It reports no actionable source finding but retains existing-install compatibility and the separately requested review hold. This replaces the stale statement that no current-head verdict was available. Fresh browser setup, installed-old-APK preservation and inspected before/after Access screenshot evidence remain unperformed. Profiles/pairing/settings/service headers/WARP and screenshot rendering in chat and PR have not been qualified through those manual flows.

Native execution uses Android 36 x86_64 emulators; four-ABI packaging is separate. Release executes installed app code in a self-instrumented fixture. Same-install restart with synthetic grants does not prove an installed-prior-version upgrade, live IdP/browser return, physical-device behavior or UI delivery. The restart fixture has no active sockets; separate wire tests supply managed transport retirement/drain proof.

Sign out removes OpenClaw's Access grant; it does not log out of the identity provider. Durability proof covers acknowledged Sign out, without establishing pre-acknowledgement crash atomicity. Merge and the dedicated user-directed security review remain held; these receipts are not overall merge or security clearance.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 19:12
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android size: XL maintainer Maintainer-authored PR labels Sep 13, 2026
@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-ingress-20260913 branch from 39e159e to 1775ee6 Compare September 13, 2026 19:20
@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-access-runtime-20260913 branch from cda357e to 66c86f1 Compare September 13, 2026 19:20
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

The Android app adds Cloudflare Access browser sign-in for Gateway profiles, preserves setup-code deadlines, retires managed connections on sign-out or forget, and adds native validation and guidance.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and boundary validation provide useful signal, but expressly unperformed browser/UI and installed-old qualification prevent merge readiness.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Merge readiness

⛔ Blocked before merge - 6 items remain

This PR remains necessary: merged prerequisites provide verification and transport support, but current main does not activate Android browser sign-in. No actionable introduced defect was found; the acknowledged qualification gaps and explicit review hold remain unresolved.

Priority: P2
Reviewed head: 1a8126346f43bfcb387e4b52dc6a6876eaba8a7b
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Has the requested dedicated security review cleared Android Access activation and authorized resuming its held integration?
  • Recommendation: Complete the held review: Keep activation paused until the designated reviewer records clearance, then qualify integration and the remaining app flows.
  • Why: The PR expressly retains a user-directed hold; a clean source pass and passing native receipts cannot release it.

Before merge

  • Resolve merge risk - Installing over a shipped, same-signer Android APK remains unqualified; existing profiles, selection, pairing, settings, custom headers, and service-header/WARP connections could change during activation.
  • Resolve merge risk - Fresh Cloudflare browser sign-in and return remain unqualified, and inspected, sanitized before/after screenshots have not been verified as rendered in both the originating chat and PR.
  • Resolve merge risk - The dedicated security-review and activation-restacking holds remain explicit; the preserved branch has not been qualified against the rebuilt prerequisite stack.
  • Complete next step - Record clearance of the dedicated security-review hold, qualify the authorized prerequisite integration, and complete browser/UI and same-signer installed-old preservation evidence before landing.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Agent review details

How this fits together

Android Gateway admission receives saved profiles, setup codes, and user connection requests. It obtains Access authorization before native node, operator, chat, and media connections proceed.

flowchart TD
  A[Saved profile or setup code] --> B[Android connection request]
  B --> C[TLS trust and Access admission]
  C --> D[Browser sign-in when required]
  D --> E[Verified current grant]
  C --> F[Independent service-header route]
  E --> G[Native sockets and media]
  F --> G
  H[Sign out or Forget] --> E
Loading

Technical review

Best possible solution:

Activate Access through the existing admission owner with demonstrated browser return, preserved installed-user state, and explicit clearance of the existing review hold.

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

Not applicable as a feature request: current source establishes the missing app activation, but this review did not execute an Android browser flow.

Is this the best way to solve the issue?

Yes, integrating the existing ingress owner is the maintainable direction; native boundary tests support it, while browser and upgrade qualification remain necessary.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Qualify installed-user preservation (recommended)
    Install the same-signer candidate over a shipped APK and verify retained profiles, pairing, settings, custom headers, and ordinary routes alongside fresh Access setup.
  2. Keep activation deferred
    Leave this draft paused while the prerequisite integration and existing review hold remain unresolved.

Security

None.

Evidence

What I checked:

  • Pinned introduction and test-merge identity: Reviewed the introduced delta from aa784f0 to the pinned head. Raw test-merge parents are that base followed by the exact head, and its tree matches the head tree. This test merge does not represent integration with subsequently fetched main. (1cfcc7b84f14)
  • App activation remains unique: The introduced runtime creates the ingress controller with encrypted persistence, profile headers, and transport retirement; Activity consumes its browser launch through Custom Tabs. Current-main NodeRuntime has no matching controller activation. The merged foundations do not supersede this app integration. (apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:1135, 1a8126346f43)
  • Current-main necessity check: Inspection found no gatewayIngress, Cloudflare, or ingressAuthorizationProvider activation in current-main NodeRuntime. Supplied GitHub metadata verifies feat(android): verify Cloudflare Access browser sessions #147061 and feat(android): prepare gateway transports for Access reauthentication #147094 as merged prerequisites, explicitly leaving browser/app activation downstream. No merged fixing PR establishes completion of this request; latest-release context likewise supplies no activation provenance. (apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt, bb3a8a9ac304)
  • Authority boundary coverage: The wire scenarios exercise production NodeRuntime, controller/store, GatewaySession, and real OkHttp TLS/WebSocket clients. They assert foreign-authority zero-send, rejected redirects, cancellation of held media, no delayed old-token upgrades, and denial of late Range requests after sign-out, Forget, or account replacement; ordinary service-header controls remain usable. Issuer discovery and authentication are synthetic, so this is transport-boundary evidence rather than live browser proof. (apps/android/app/src/test/java/ai/openclaw/app/gateway/GatewayIngressWireTest.kt:65, 1a8126346f43)
  • Persistent deadline and upgrade boundary: GatewayCredentials gains a serialized bootstrapExpiresAtMs field with a null default and clears it with the matching bootstrap handoff. The native restart fixture seeds legacy records into the candidate installation and verifies acknowledged deletion across processes; it does not install over a previously shipped APK. (apps/android/app/src/main/java/ai/openclaw/app/SecurePrefs.kt:50, 1a8126346f43)
  • Native receipts retained with their limits: The captured PR body reports four passing Android 36 emulator cells, including installed optimized Release binding execution and two-process Debug deletion receipts. Live GitHub job metadata independently confirms all eight Android jobs succeeded for the pinned head. Downloaded proof scratch contained no files; fetching detailed logs was blocked at results-receiver.actions.githubusercontent.com. That reviewer limitation does not invalidate the supplied receipts. (.github/workflows/ci.yml:5738, 1a8126346f43)

PR surface

Source +732, Tests +1735, Docs +30, Config +49, Other +143. Total +2689 across 32 files.

View PR surface stats
Area Files Added Removed Net
Source 20 804 72 +732
Tests 9 1849 114 +1735
Docs 1 30 0 +30
Config 1 56 7 +49
Generated 0 0 0 0
Other 1 143 0 +143
Total 32 2882 193 +2689

Review metrics

Metric Value Why it matters
Production versus test growth Production Kotlin +375 net; Kotlin and TypeScript tests/test support +1,833 net Production growth implements app activation through the existing owner; most added validation covers admission, retirement, persistence, and native packaging.
Persistent credential fields 1 optional deadline field added A saved bootstrap deadline now crosses process restarts, making existing-install compatibility an independent gate.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded Android connection capability with unresolved activation qualification, rather than an established urgent regression.
  • merge-risk: 🚨 compatibility: The new admission path and persisted setup deadline have not been qualified over a shipped installation with existing profiles and credentials.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Demonstrate fresh Cloudflare browser sign-in and return, with sanitized before/after screenshots rendered in both required destinations.
  • Install over a shipped same-signer APK and verify retained profiles, pairing, settings, custom headers, and service-header/WARP connections.
  • Obtain the held security-review disposition, then qualify the authorized prerequisite integration and its exact-head checks.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-14T04:31:40.092Z sha 9e1715b :: blocked before merge. :: none
  • reviewed 2026-09-14T05:07:59.577Z sha 0c5c767 :: blocked before merge. :: none
  • reviewed 2026-09-14T05:42:35.764Z sha 0c5c767 :: blocked before merge. :: none
  • reviewed 2026-09-14T07:50:51.022Z sha eab8277 :: blocked before merge. :: none
  • reviewed 2026-09-14T08:51:51.594Z sha f4319f6 :: blocked before merge. :: none
  • reviewed 2026-09-14T09:43:24.736Z sha f4319f6 :: blocked before merge. :: none
  • reviewed 2026-09-23T06:21:01.559Z sha 1a81263 :: blocked before merge. :: none
  • reviewed 2026-09-24T11:45:12.263Z sha 1a81263 :: blocked before merge. :: none

Reviewed October 5, 2026, 10:59 AM ET / 14:59 UTC (Revision 20).

@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-access-runtime-20260913 branch 3 times, most recently from 7f571c6 to 4ab2fbb Compare September 13, 2026 20:57
@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-ingress-20260913 branch from 38de691 to 82839cb Compare September 14, 2026 02:30
@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-access-runtime-20260913 branch from d35072d to 056fb88 Compare September 14, 2026 02:30
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 14, 2026
@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-access-runtime-20260913 branch from 056fb88 to 15f2734 Compare September 14, 2026 02:39
@blacksmith-sh

This comment has been minimized.

@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-ingress-20260913 branch from f3477d2 to 625bf69 Compare September 14, 2026 03:35
@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-access-runtime-20260913 branch from 15f2734 to a4fafb1 Compare September 14, 2026 03:35
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 14, 2026
@vincentkoc
vincentkoc marked this pull request as draft September 14, 2026 10:05
@vincentkoc
vincentkoc force-pushed the feat/android-cloudflare-access-runtime-20260913 branch from f4319f6 to 1a81263 Compare September 14, 2026 10:10
@vincentkoc
vincentkoc force-pushed the fix/android-markdown-source-spans-20260914 branch from b64ab17 to aa784f0 Compare September 14, 2026 10:10
@vincentkoc
vincentkoc marked this pull request as ready for review September 14, 2026 10:13
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@vincentkoc
vincentkoc marked this pull request as draft September 23, 2026 06:02
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 23, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant