Repository navigation
refactor(android): deslop Android app third pass - #159589
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 27, 2026, 7:24 AM ET / 11:24 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch consolidates duplicate parsing, models, UI projections, and forwarding code across the Android phone and Wear apps, and simplifies Android release helpers. Merge readiness✅ Ready for maintainer review Keep this PR open. It contains distinct Android cleanup beyond the two merged earlier passes, and current Priority: P3 Review scores
Verification
How this fits togetherThe Android phone and Wear clients turn user actions and Gateway events into chat, voice, device, and screen state. The changed helpers sit between those inputs and the Gateway requests, device operations, and rendered results. flowchart LR
A[Phone and Wear input] --> B[Android view model]
B --> C[Chat and voice controllers]
C --> D[Gateway session]
D --> E[Gateway messages]
D --> F[Node handlers]
F --> G[Android device APIs]
B --> H[Phone and Wear screens]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -2, Other -692. Total -694 across 57 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep Android phone and Wear on the shared parser and state owners established by this branch while preserving their existing Gateway, preference, and trust contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes internal cleanup rather than reporting a defect to reproduce. Is this the best way to solve the issue? Yes. Reusing the existing owners removes duplicate code while retaining the observed preference, TLS, and Gateway boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2d65bdd956d9. 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
HistoryReview history (3 earlier review cycles)
|
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
* refactor(android): deslop Android app third pass * chore(android): refresh native string source sites
What Problem This Solves
Maintainer-requested third Android cleanup pass removes duplicated parsers, projections, and forwarding layers left after the earlier passes. Related: #158539, #159154.
User Impact
No user-visible behavior change. Gateway payloads, localized strings, authorization and ownership checks, lifecycle ordering, Wear integration, and the 4 KB / 16 KB page-size checks stay unchanged.
Why This Change Was Made
The measured candidate removes 683 net native production lines and 9 tooling lines (692 total production/tooling lines). Tests are 2 lines smaller; existing behavioral assertions are preserved. This is below the 1,000-line target after the full source sweep, so the required coverage log is included below.
Evidence
Blacksmith Testbox proof completed on
tbx_01m3gzhqhw2w9mcncxvt6pa22v(run); the lease was stopped after proof.pnpm native:i18n:verify: passed after regenerating the source-site inventory on Testboxtbx_01m3h6g98kax108qhfkwjc3evf. A strict comparison proved all 4,050 IDs/texts/platforms unchanged, with only four obsoleteNodeRuntime.ktsites removed; separate Codex review of this generated diff was scoped-clean through P2. The first hosted CI stopped at this stale inventory and cancelled downstream Android jobs; the corrected head passed fresh CI.pnpm android:i18n:check: passed (1,857 phone keys, 4 third-party keys, 137 Wear keys; all configured locales).src/infra/fs-safe-import-boundary.test.tsplus plugin, Control UI, test-helper, and boundary-checker siblings) and Android release-artifact/Fastlane gate tests: passed; 17.30 s wall for the selected Vitest invocation.node scripts/check-changed.mjs: passed; 34.26 s wall. Ruby syntax: passed.tbx_01m3h3ygd71ngj9g7awc0qmh72: scoped-clean through P2, no accepted/actionable findings. The reviewed candidate exactly matched the native proof tree; the clean rebase preserved its stable patch ID. Exact-head CI run 36313916413 passed for10611dfbe0f7a58c8a4c165946877befb739e73e, including all Android jobs, 4 KB and 16 KB native Access tests, andopenclaw/ci-gate.Changed tests only migrate callers/assertions to canonical result types and owners. Their measured JUnit suite times on Testbox were 1.506–1.777 s for model-selection flow, 3.773–6.269 s for settings insets, 0.004–0.008 s for model ordering, 0.005–0.009 s for stance timing, 0.018 s for SMS, 0.088 s for Wear history, and 3.299 s for the Wear context picker. No new test cases or added test work. Hosted Android job wall times: Play 456 s, third-party 424 s, Wear 390 s, Kotlin lint 368 s, and each native page-size job 639 s.
Remote execution and lease closeout
Provider: Blacksmith Testbox. Every test, lint/check, and build ran remotely; local execution was limited to repository operations, reads, edits, and formatting.
tbx_01m3gvqk7re2kea0vhasyyjh2d(run)tbx_01m3gzhqhw2w9mcncxvt6pa22v(run)tbx_01m3h3ygd71ngj9g7awc0qmh72(run)tbx_01m3h6g98kax108qhfkwjc3evf(run)Native Gradle task set:
Fixes Found Along the Way
No separately established product bug or flaky test so far.
Coverage log: every original first-party production source/build/script file over 200 lines (135 files)
Read largest-first, starting with files untouched by Android commits since 2026-09-20. Generated first-party Kotlin is included and preserved; tests, vendored assets, translation resources, and generated build outputs are outside this production-source census.
apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.ktapps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SettingsScreens.ktapps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.ktapps/android/app/src/main/java/ai/openclaw/app/voice/TalkModeManager.ktapps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearScreens.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearViewModel.ktapps/android/app/src/main/java/ai/openclaw/app/MainViewModel.ktapps/android/app/src/main/java/ai/openclaw/app/i18n/NativeStringResources.ktapps/android/app/src/main/java/ai/openclaw/app/ui/ShellScreen.ktapps/android/app/src/main/java/ai/openclaw/app/chat/ChatCommandOutbox.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SessionsScreen.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SidebarContent.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMarkdown.ktapps/android/app/src/main/java/ai/openclaw/app/SecurePrefs.ktapps/android/app/src/thirdParty/java/ai/openclaw/app/node/SmsManager.ktapps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayProtocol.ktapps/android/app/src/main/java/ai/openclaw/app/AndroidScreenshotFixture.ktapps/android/app/src/main/java/ai/openclaw/app/wear/WearRealtimeTalkController.ktapps/android/app/src/main/java/ai/openclaw/app/voice/MicCaptureManager.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearGatewayRepository.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/SessionDiffSheet.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SkillsSettingsScreen.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMediaPlayer.ktapps/android/app/src/main/java/ai/openclaw/app/chat/ClientDatabases.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageViews.ktapps/android/app/src/main/java/ai/openclaw/app/wear/WearProxyController.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatTimeline.ktapps/android/wear/src/main/java/ai/openclaw/wear/MainActivity.ktapps/android/app/src/main/java/ai/openclaw/app/ui/design/ClawComponents.ktapps/android/app/src/main/java/ai/openclaw/app/GatewayExecApprovals.ktapps/android/app/src/main/java/ai/openclaw/app/ui/CronJobManagementPanel.ktapps/android/app/src/main/java/ai/openclaw/app/CronJobManagement.ktapps/android/app/src/main/java/ai/openclaw/app/ConversationNotifications.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SkillWorkshopSettingsScreen.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SidebarComponents.ktapps/android/fastlane/Fastfileapps/android/app/build.gradle.ktsapps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayDiscovery.ktapps/android/app/src/main/java/ai/openclaw/app/wear/WearProxyBridge.ktapps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayTls.ktapps/android/app/src/main/java/ai/openclaw/app/chat/ChatModels.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearTalkAvatar.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearRealtimeTalkClient.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearProxyClient.ktapps/android/app/src/main/java/ai/openclaw/app/ui/NodesDevicesSettingsScreen.ktapps/android/app/src/main/java/ai/openclaw/app/wear/WearRealtimeChannelRegistry.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatInlineWidgetView.ktapps/android/app/src/main/java/ai/openclaw/app/chat/ChatTranscriptCache.ktapps/android/app/src/main/java/ai/openclaw/app/ui/GatewayConfigResolver.ktapps/android/app/src/main/java/ai/openclaw/app/voice/VoiceWakeManager.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatDictation.ktapps/android/app/src/main/java/ai/openclaw/app/voice/RealtimeAgentCoordinator.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatComposer.ktapps/android/app/src/main/java/ai/openclaw/app/node/CameraCaptureManager.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearVoiceControls.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatWorkingIndicator.ktapps/android/app/src/main/java/ai/openclaw/app/node/DeviceNotificationListenerService.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatCodeHighlight.ktapps/android/app/src/main/java/ai/openclaw/app/ui/design/MascotAnimator.ktapps/android/app/src/main/java/ai/openclaw/app/node/DeviceHandler.ktapps/android/app/src/main/java/ai/openclaw/app/voice/AndroidAudioInputSession.ktapps/android/app/src/thirdParty/java/ai/openclaw/app/accessibility/AccessibilityDevActivity.ktapps/android/app/src/main/java/ai/openclaw/app/ui/FoldAwareDropdownMenu.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatRichBlockRenderer.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatReaderScrollController.ktapps/android/app/src/thirdParty/java/ai/openclaw/app/accessibility/AccessibilityActionExecutor.ktapps/android/scripts/build-release-artifacts.tsapps/android/app/src/main/java/ai/openclaw/app/ui/WorkspaceFilesScreen.ktapps/android/app/src/main/java/ai/openclaw/app/PermissionRequester.ktapps/android/app/src/main/java/ai/openclaw/app/systemagent/SystemAgentChatController.ktapps/android/app/src/main/java/ai/openclaw/app/ui/ProvidersModelsScreen.ktapps/android/app/src/main/java/ai/openclaw/app/ui/design/ClawTheme.ktapps/android/scripts/perf-online-benchmark.shapps/android/app/src/main/java/ai/openclaw/app/ui/design/OpenClawMascot.ktapps/android/app/src/main/java/ai/openclaw/app/node/ContactsHandler.ktapps/android/app/src/main/java/ai/openclaw/app/ui/image/SafeRemoteImage.ktapps/android/app/src/main/java/ai/openclaw/app/NodeForegroundService.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatCameraActivity.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatComposerStateStore.ktapps/android/app/src/main/java/ai/openclaw/app/node/CalendarHandler.ktapps/android/app/src/main/java/ai/openclaw/app/SessionCatalog.ktapps/android/wear-shared/src/main/java/ai/openclaw/wear/shared/WearProtocol.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/BackgroundTasksSheet.ktapps/android/app/src/main/java/ai/openclaw/app/voice/RealtimePlayout.ktapps/android/app/src/main/java/ai/openclaw/app/MainActivity.ktapps/android/app/src/main/java/ai/openclaw/app/ui/CommandPalette.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SystemAgentSettingsScreen.ktapps/android/app/src/main/java/ai/openclaw/app/i18n/NativeStrings.ktapps/android/app/src/main/java/ai/openclaw/app/ProviderAuthController.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatWorkedSummary.ktapps/android/app/src/main/java/ai/openclaw/app/node/MotionHandler.ktapps/android/app/src/main/java/ai/openclaw/app/CronJobDetail.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatImageCodec.ktapps/android/app/src/main/java/ai/openclaw/app/ui/SidebarGatewayControl.ktapps/android/app/src/main/java/ai/openclaw/app/ui/ControlUiWebView.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatQuestionCard.ktapps/android/app/src/main/java/ai/openclaw/app/ui/GatewayAdditionDialog.ktapps/android/app/src/main/java/ai/openclaw/app/chat/VoiceNoteRecorderController.ktapps/android/app/src/main/java/ai/openclaw/app/GatewayNodeApproval.ktapps/android/app/src/main/java/ai/openclaw/app/chat/ChatSwarmProgress.ktapps/android/app/src/main/java/ai/openclaw/app/node/PhotosHandler.ktapps/android/app/src/thirdParty/java/ai/openclaw/app/accessibility/AccessibilitySnapshotter.ktapps/android/wear/src/main/java/ai/openclaw/wear/WearReplyNotifier.ktapps/android/app/src/main/java/ai/openclaw/app/voice/TalkAudioPlayer.ktapps/android/app/src/main/java/ai/openclaw/app/GatewayTalkSetupReadiness.ktapps/android/app/src/main/java/ai/openclaw/app/SkillManagement.ktapps/android/app/src/main/java/ai/openclaw/app/ui/design/TalkWaveform.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatTurnRecap.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatWidgetExport.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatReaderAnchors.ktapps/android/app/src/main/java/ai/openclaw/app/ui/HealthLogsSettingsScreen.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatLinkPreview.ktapps/android/app/src/main/java/ai/openclaw/app/ui/AboutBuildIdentity.ktapps/android/app/src/main/java/ai/openclaw/app/ui/FoldAwareSheet.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatAttachmentMenu.ktapps/android/app/src/debug/java/ai/openclaw/app/VoiceE2eReceiver.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageActions.ktapps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayRegistry.ktapps/android/app/src/main/java/ai/openclaw/app/gateway/CloudflareAccessClient.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/PendingAttachment.ktapps/android/app/src/main/java/ai/openclaw/app/AssistantLaunch.ktapps/android/scripts/voice-e2e.shapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatComposerPopover.ktapps/android/app/src/main/java/ai/openclaw/app/gateway/CloudflareAccessSessionStore.ktapps/android/app/src/main/java/ai/openclaw/app/ui/ProviderSignInDialog.ktapps/android/app/src/thirdParty/java/ai/openclaw/app/node/MobileUiHandler.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatImageViewer.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatSourcePreviews.ktapps/android/app/src/main/java/ai/openclaw/app/gateway/DeviceIdentityStore.ktapps/android/app/src/thirdParty/java/ai/openclaw/app/node/CallLogHandler.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/VoiceNoteComposer.ktapps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMermaidBlock.kt