Repository navigation
refactor(android): deslop Android app second pass - #159154
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 4:53 PM ET / 20:53 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch simplifies Android phone and Wear code by removing forwarding layers and consolidating chat, Gateway, device, and UI helpers. Merge readiness✅ Ready for maintainer review Keep open. The merged first Android cleanup does not cover this distinct follow-up, and current main still contains forwarding layers the branch removes. The pinned merge is clean, exact-head checks passed, and this review found no concrete introduced defect. Priority: P3 Review scores
Verification
How this fits togetherThe Android phone and Wear clients receive Gateway sessions and events, then route chat and device actions to their controllers and screens. This change reduces intermediate code along those paths. flowchart LR
Gateway[Gateway sessions and events] --> Runtime[Android runtime]
Preferences[Credentials and preferences] --> Runtime
Runtime --> Chat[Chat controller]
Chat --> Phone[Phone chat and settings]
Runtime --> Device[Phone device actions]
Runtime --> Wear[Wear controls]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +13, Other -1130. Total -1117 across 72 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep chat state with its controller and preserve credential, preference, and Gateway contracts while completing normal Android review. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reports duplicated implementation, not a failing user flow; the redundant forwarding paths are visible in current-main source. Is this the best way to solve the issue? Yes: routing callers to the existing chat controller removes duplicate ownership without adding a new subsystem; the inspected credential and session checks retain their prior contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 19c6ef8d9e02. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
What Problem This Solves
Android retains redundant forwarding layers and repeated parsing, projection, and lifecycle code after the first cleanup pass.
Related: #158539. This second pass preserves that PR's changes.
User Impact
No intentional user-visible change. Gateway protocol and pairing/auth flows, permission requests and text, notification channels/IDs, preferences and database migrations, intents/deep links, rendered appearance, signing, and dependencies are preserved.
Why This Change Was Made
NodeRuntimeforwarding methods and 33 flow aliases;MainViewModelconsumes the existingChatControllerwhile retaining lazy startup and stable UI flows. Runtime methods that own selection or lifecycle work stay in place.Measured reduction: 1,001 production lines, excluding tests and screenshot fixtures. Screenshot fixtures remove another 127 lines; test changes add 13 lines, mostly receiver migration/formatting. The generated native localization inventory removes two unreachable strings without changing active translations.
The full production subtree was read, including every file over 200 lines. No new tests or dependencies were added. The existing tests retain their observable assertions; test-only adapters and duplicate helper expectations were removed.
Evidence
Blacksmith Testbox proof used the repository wrapper and verified hashes of all changed Android files before execution. Provider:
blacksmith-testbox; lease:tbx_01m3fdxrye30adn4jmb8ws76rz.src/infra/fs-safe-import-boundary.test.ts.After retaining the toolchain-required API-33 guard, the final candidate passed both phone assemblies and both instrumentation-test Kotlin compilations (36 seconds), 40 notification/routing tests per phone flavor (11 seconds each; 80 total), both phone framework-lint variants plus Kotlin lint (179 seconds), native localization verification, and changed-file checks (22 seconds). Wear framework lint was green in the full pass above. All builds/tests/lint ran on Testbox; no local fallback was used.
Validation caught a Kotlin compiler limitation in an unused default suspend callback; the final API requires the existing store-owner callback, which both production callers already supplied. Framework lint also requires the local API-33 guard around
POST_NOTIFICATIONS; that guard is retained with its reason documented.Exact-head hosted CI run 36269262420 passed for
38025041fddadd789b14ab103ecbd8e43f1209ef, including both 4 KB and 16 KB Android native checks, security, native localization, type/boundary checks, andopenclaw/ci-gate. ClawSweeper completed its review of that head with no actionable findings.CI Android task-step wall time (including each step's compilation/lint work):
Remote Gradle and boundary commands
Final guard verification additionally ran:
cd apps/android ./gradlew --no-daemon :app:assemblePlayDebug :app:assembleThirdPartyDebug :app:compilePlayDebugAndroidTestKotlin :app:compileThirdPartyDebugAndroidTestKotlin ./gradlew --no-daemon :app:testPlayDebugUnitTest --tests ai.openclaw.app.ConversationNotificationsTest --tests ai.openclaw.app.ConversationNotificationRoutingTest ./gradlew --no-daemon :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.ConversationNotificationsTest --tests ai.openclaw.app.ConversationNotificationRoutingTestThe Android invocations use one explicit build commit/timestamp per proof run. Existing tests were migrated without adding cases; the full-suite and final focused timings above measure their validation cost.