Skip to content

refactor(android): remove obsolete chat rendering paths - #119615

Merged
steipete merged 1 commit into
mainfrom
codex/loc-0805-native-apps-dmvazq
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/loc-0805-native-apps-dmvazq

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Android retained an obsolete, parallel message/tool-rendering stack after the live conversation UI moved to ChatBubble and ToolBubble. The abandoned tool-display registry, old message/media/voice composables, and duplicate relative-time formatters inflated the Android owner surface and left regression tests targeting UI that users never see.

Why This Change Was Made

Remove the unreachable Android-only rendering/registry branches and keep the existing live ChatBubble/ToolBubble flow as the single owner. Reuse canonical relativeSessionTime for overview and command-palette timestamps, migrate managed-image and legacy-media checks onto the real chat bubble, and preserve UTF-16 surrogate-boundary coverage in its existing owner test. Regenerate only the canonical native-source inventory from surviving Android strings; translated catalogs, generated Android resources, and Apple sources are unchanged.

User Impact

No intended visible behavior change: existing tool presentation, managed images, audio/video fallback labels, voice-note flows, session timestamps (now, 5m, 3h, 2d), and surrogate-safe text truncation remain intact. Android becomes easier to maintain through one live rendering path and a source inventory that matches the actual native UI.

Evidence

  • Size: Android production -556 LOC; Android tests -31 LOC; canonical native-source inventory -144 LOC; -731 LOC total across 12 files.
  • Native inventory: pnpm native:i18n:baseline regenerated only apps/.i18n/native-source.json; 5,393 entries, SHA-256 6bde2ed6b71bb8c09b3cfa4e24b4a677bc04e647b5d1612cf0508ae3fd21c910. pnpm native:i18n:verify passed (changed=false; Android app 1,649 keys, third-party 4, Wear 87, Apple 1,249). No translations, generated resources, or Apple files changed.
  • Real Android regression proof: both Gradle :app:testPlayDebugUnitTest and :app:testThirdPartyDebugUnitTest passed against Utf16TextTest, SessionsScreenGroupingTest, CommandPaletteLogicTest, ChatMessageViewsTest, ChatScreenTest, and ChatMediaPlayerTest: 36 tests per variant, 72 total; zero failures, errors, or skips. This directly exercises the live chat bubble, managed image/media fallbacks, canonical timestamps, and UTF-16 surrogate limits.
  • Full repository gate: unmodified OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 corepack pnpm check:changed passed the apps lane, including the native state schema guard.
  • Remote proof: Blacksmith Testbox Android and native-i18n run; Android SDK 37 and JDK 17, both real store variants.
  • Independent review: complete Android owner/caller/history/i18n audit plus exact .agents/skills/autoreview/scripts/autoreview --mode local --engine codex --model gpt-5.6-sol --thinking xhigh: no accepted/actionable findings, confidence 0.98.

Real Android 16 emulator evidence (exact reviewed commit)

  • Runtime: real Android 16 / API 36 x86_64 emulator with KVM acceleration, exact reviewed commit f99de8c2860c207d8d75469359adabc2b4bfce79, Play debug APK SHA-256 f6903f8918609085b1276949e6d6d034b862983f2501c1df4d46e9e600e97fd3; captured screenshots are 1080 × 1920.
  • Production MainActivity chat and timestamps: actual user message “Draft a short status update for the team.”, assistant release-review response, and visible 12:01 AM, 12:00 AM, and 11:59 PM timestamps. Screenshot fixture-chat.png SHA-256: b2ee1e01a8f4e8075389dcbb2f012434084d053105b55b8594608acb00c32893.
  • Production ChatBubble managed image and media fallbacks: canonical resolved managed image “Managed artifact image” / “Open image preview”, audio fallback voice-note-proof.m4a (1:05), video fallback release-preview-proof.mp4 (0:09), and 12:02 AM timestamp. Screenshot managed-media.png SHA-256: 3dca9db02a0a1f725cabf992c05a2c0311986670b037514b098dee7799335adf.
  • Real-emulator instrumentation: OK (2 tests); separately observed production ToolBubble Tools running, search_release_checklist, OpenClaw is working, You, Show release checklist tools, and 12:01 AM. The ToolBubble observation is instrumentation/UI-tree evidence; no separate ToolBubble screenshot is attached.
  • Exact-head emulator run: https://github.com/openclaw/openclaw/actions/runs/31014321863

Production MainActivity: real chat and timestamps

Production Android MainActivity chat conversation and visible timestamps

Production ChatBubble: managed image, audio, and video fallback

Production Android ChatBubble with managed artifact image and audio and video fallback durations

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: L maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete
steipete marked this pull request as ready for review August 5, 2026 13:26
@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 5, 2026, 10:15 AM ET / 14:15 UTC.

ClawSweeper review

What this changes

The PR removes unused Android chat and tool-rendering paths, consolidates session timestamps on the shared formatter, retargets tests to the live renderer, and refreshes the native-string inventory.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

The source supports this as the right canonical-path cleanup: production chat already uses ChatBubble and ToolBubble, while the deleted renderer stack has no production callers. Keep it open because the protected maintainer label requires human handling and the cited Robolectric/CI evidence is still mock-only rather than inspectable Android runtime proof.

Priority: P3
Reviewed head: f99de8c2860c207d8d75469359adabc2b4bfce79

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is a well-scoped, source-supported cleanup, but merge readiness is capped by mock-only behavior proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The cited Gradle/Robolectric tests and CI runs exercise code but do not provide inspectable after-fix behavior from a real Android runtime; add redacted device/emulator evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The cited Gradle/Robolectric tests and CI runs exercise code but do not provide inspectable after-fix behavior from a real Android runtime; add redacted device/emulator evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Live production owner: Current main dispatches persisted messages to the live chat bubble and pending tools to the local tool bubble; the retained bubble renders managed images plus playable-media and fallback-label paths.
Legacy paths are not the active implementation: On current main, the old renderer and registry definitions remain, but exact production-callsite searches found the live timeline uses ChatBubble/ToolBubble instead; their remaining references are definitions and obsolete tests.
Canonical test migration: The branch exposes only the live ChatBubble to package tests and moves managed-image and legacy-media assertions there; UTF-16 boundary coverage moves to the shared truncation helper.
Findings None None.
Security None None.

How this fits together

Gateway conversation and session data enter Android’s chat timeline, which renders persisted and streaming messages through the live chat bubble and pending tools through its tool bubble. The cleanup removes an older parallel renderer so those live paths remain the sole presentation owners.

flowchart LR
  A[Gateway conversation data] --> B[Android chat timeline]
  B --> C[Live chat bubble]
  B --> D[Pending tool bubble]
  E[Session update time] --> F[Shared timestamp formatter]
  F --> G[Session and command lists]
  C --> H[Message media and actions]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The cited Gradle/Robolectric tests and CI runs exercise code but do not provide inspectable after-fix behavior from a real Android runtime; add redacted device/emulator evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - No inspectable after-fix Android device/emulator evidence demonstrates that the retained live UI behaves correctly outside Robolectric; the cited tests and CI are supplemental proof only.
  • Complete next step (P2) - No mechanical defect needs an automated repair; the remaining blocker is real Android runtime proof and protected-label handling.
Agent review details

Security

None.

PR surface

Other -731. Total -731 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 12 110 841 -731
Total 12 110 841 -731

Review metrics

Metric Value Why it matters
Owner-surface LOC production −556, tests −31, inventory −144 The branch materially reduces duplicate Android rendering surface while moving coverage to the live owner.

Stored data model

Persistent data-model change detected: vector/embedding metadata: apps/android/app/src/main/java/ai/openclaw/app/ui/CommandPalette.kt, vector/embedding metadata: apps/android/app/src/main/java/ai/openclaw/app/ui/ShellScreen.kt. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Add Android runtime proof (recommended)
    Attach a redacted emulator or device recording/output that exercises the retained live chat bubble’s managed-image and media fallback behavior before merging.
  2. Accept an explicit proof waiver
    A maintainer may explicitly waive the runtime-proof gate if they judge the focused Robolectric and CI evidence sufficient for this behavior-neutral cleanup.

Technical review

Best possible solution:

Keep the live ChatBubble/ToolBubble owner consolidation, then attach redacted emulator or device evidence exercising a managed image and audio/video fallback in a real Android runtime before merge.

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

Not applicable: this PR is a cleanup, not a report of a separately reproducible defect. Source inspection does establish that the live Android route is the retained ChatBubble/ToolBubble path.

Is this the best way to solve the issue?

Yes, with the proof gate satisfied: removing uncalled parallel renderers and testing the active owner is more maintainable than preserving duplicate UI paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against acc31c3af3b1.

Labels

Label changes:

  • add merge-risk: 🚨 other: A large UI-path deletion lacks inspectable device/emulator proof that the retained renderer behaves correctly in a real Android runtime.

Label justifications:

  • P3: This is a behavior-neutral Android maintenance cleanup with limited blast radius.
  • merge-risk: 🚨 other: A large UI-path deletion lacks inspectable device/emulator proof that the retained renderer behaves correctly in a real Android runtime.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The cited Gradle/Robolectric tests and CI runs exercise code but do not provide inspectable after-fix behavior from a real Android runtime; add redacted device/emulator evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame for the live chat timeline, shared formatter, and old parallel stack resolves to this contributor’s recent Android chat commit. (role: recent Android chat feature contributor; confidence: high; commits: dc93ea6d699a, f99de8c2860c; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/SessionsScreen.kt, apps/android/app/src/main/java/ai/openclaw/app/tools/ToolDisplay.kt)

Rank-up moves

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

  • Attach redacted post-fix Android emulator/device evidence showing the live chat bubble handles a managed image and audio/video fallback.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-05T13:33:25.963Z sha f99de8c :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 5, 2026
@steipete
steipete merged commit 4511c9b into main Aug 5, 2026
157 of 160 checks passed
@steipete
steipete deleted the codex/loc-0805-native-apps-dmvazq branch August 5, 2026 15:17
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

app: android App: android maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant