Skip to content

fix(android): stabilize recent sessions overview#101161

Merged
Solvely-Colin merged 2 commits into
mainfrom
codex/android-recent-sessions-stability
Jul 7, 2026
Merged

fix(android): stabilize recent sessions overview#101161
Solvely-Colin merged 2 commits into
mainfrom
codex/android-recent-sessions-stability

Conversation

@Solvely-Colin

@Solvely-Colin Solvely-Colin commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Android Home's Recent Sessions panel could visibly flash as gateway refreshes delivered duplicate or partial session rows. The panel could briefly reorder rows or replace nonblank row metadata with blank metadata during refresh churn.

Why This Change Was Made

This keeps Home's Recent Sessions ordering aligned with the Sessions screen recency contract (lastActivityAt ?: updatedAtMs), deduplicates repeated session keys by the newest entry, and preserves prior nonblank row fields for the same visible session while a partial refresh frame is in flight.

User Impact

The Recent Sessions section should stop flashing between row states during live refreshes while still reflecting the current recent-session candidates and newly active sessions.

Evidence

  • JAVA_HOME='/Applications/Android Studio.app/Contents/jbr/Contents/Home' ANDROID_HOME="$HOME/Library/Android/sdk" ANDROID_SDK_ROOT="$HOME/Library/Android/sdk" ./gradlew testPlayDebugUnitTest --tests ai.openclaw.app.ui.ShellScreenLogicTest
  • .agents/skills/autoreview/scripts/autoreview --mode local -> clean, no accepted/actionable findings
  • pnpm native:i18n:sync refreshed apps/.i18n/native-source.json
  • pnpm native:i18n:check -> native-app-i18n: entries=2775 changed=false
  • git diff --check
  • Installed clean branch with ./gradlew installPlayDebug on OpenClaw_StableProof_API_35(AVD) - 15
  • Relaunched ai.openclaw.app/.MainActivity and sampled Recent Sessions; row stayed stable as OpenClaw Windows Tray / OpenClaw / now

Visual Proof

Before = current origin/main without this PR. After = this PR branch.

Recent Sessions before and after

Before:

Before Recent Sessions fix

After:

After Recent Sessions fix

Copilot AI review requested due to automatic review settings July 6, 2026 19:37
@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: S maintainer Maintainer-authored PR labels Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the Android Home “Recent Sessions” panel by making recent-session ordering deterministic and by smoothing UI row updates during refresh churn, aligning recency with the Sessions screen contract (lastActivityAt ?: updatedAtMs).

Changes:

  • Reworked recent-session selection to dedupe by session key and sort by recency (lastActivityAt preferred), with deterministic tie-breaking.
  • Updated overview row metadata to prefer lastActivityAt when available.
  • Added a small “stable rows” merge step so partial refresh frames don’t blank out previously rendered row fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/android/app/src/test/java/ai/openclaw/app/ui/ShellScreenLogicTest.kt Adds/updates unit tests to cover recency sorting, last-activity preference, deduping, stable tie ordering, and stable-row behavior during partial refresh.
apps/android/app/src/main/java/ai/openclaw/app/ui/ShellScreen.kt Implements recency-based session ordering/deduping and introduces stable recent-session row handling in the Overview screen to reduce UI flashing.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 8:38 PM ET / 00:38 UTC.

Summary
The branch changes Android Home Recent Sessions to sort and deduplicate by last activity, preserve nonblank row fields across partial refreshes, add ShellScreen logic tests, and refresh native i18n inventory anchors.

PR surface: Other +136. Total +136 across 3 files.

Reproducibility: yes. Current main is source-reproducible because Home still uses incoming session order and updatedAtMs-only metadata while the sibling Sessions screen uses lastActivityAt ?: updatedAtMs; the inspected before/after media shows the visible flicker/duplication improve, though I did not rerun the emulator.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Refresh or confirm exact merge-ref CI against current main before landing.

Risk before merge

  • [P1] The PR is mergeable but behind current main, so maintainers should rely on an exact merge-ref check or a quick refresh before landing.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused Android Home stabilization after maintainer approval and current-main merge validation, without expanding this PR into broader session-cache merge semantics.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair job is needed; the remaining action is protected-label maintainer review and any desired refresh against current main before landing.

Maintainer decision needed

  • Question: Should maintainers land this protected maintainer-labeled Android Home Recent Sessions fix after current-main merge validation remains green?
  • Rationale: The patch has sufficient proof and no blocking findings, but the maintainer label and final landing choice are explicitly maintainer-controlled rather than a cleanup close or repair-lane decision.
  • Likely owner: steipete — Recent Android session grouping work makes this the best available owner for the final session-surface merge choice.
  • Options:
    • Land after merge validation (recommended): Approve or land the focused UI fix once the branch is refreshed or exact merge-ref checks are green against current main.
    • Ask for one more refresh: Request a rebase if maintainers want checks run directly on the latest base before review.
    • Hold for broader session design: Pause only if maintainers want this solved in shared session-cache semantics rather than in the Home UI projection.

Security
Cleared: The diff touches Kotlin Android UI logic, Android unit tests, and native i18n inventory line anchors only; no workflow, dependency, lockfile, script, permission, publishing, or secret-handling surface changed.

Review details

Best possible solution:

Land the focused Android Home stabilization after maintainer approval and current-main merge validation, without expanding this PR into broader session-cache merge semantics.

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

Yes. Current main is source-reproducible because Home still uses incoming session order and updatedAtMs-only metadata while the sibling Sessions screen uses lastActivityAt ?: updatedAtMs; the inspected before/after media shows the visible flicker/duplication improve, though I did not rerun the emulator.

Is this the best way to solve the issue?

Yes. The PR is a narrow UI-layer fix that aligns Home with the existing Sessions recency contract and avoids changing global ChatController or cache merge semantics for a visible Home-only stability issue.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a focused Android Home UI stability bug fix with limited blast radius and no evidence of data loss, security impact, or unusable core runtime.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): Sufficient: inspected before/after visual media shows the Home Recent Sessions row duplication/reordering before the fix and stable rows after, with emulator install/relaunch proof and Android validation commands in the PR discussion.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: inspected before/after visual media shows the Home Recent Sessions row duplication/reordering before the fix and stable rows after, with emulator install/relaunch proof and Android validation commands in the PR discussion.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. Sufficient: inspected before/after visual media shows the Home Recent Sessions row duplication/reordering before the fix and stable rows after, with emulator install/relaunch proof and Android validation commands in the PR discussion.
Evidence reviewed

PR surface:

Other +136. Total +136 across 3 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 3 202 66 +136
Total 3 202 66 +136

What I checked:

Likely related people:

  • Solvely-Colin: Authored the merged Android Overview control-surface PR that introduced the Home Recent Sessions panel and the merged Android refresh-stability PR that extracted the current recent-session helpers. (role: feature introducer and recent area contributor; confidence: high; commits: 5e342c774d8d, 9c2bbd07506e; files: apps/android/app/src/main/java/ai/openclaw/app/ui/ShellScreen.kt, apps/android/app/src/test/java/ai/openclaw/app/ui/ShellScreenLogicTest.kt, apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt)
  • steipete: Authored and merged recent mobile session grouping work that touched Android SessionsScreen, MainViewModel, and ChatController around session-list behavior. (role: recent adjacent session contributor; confidence: medium; commits: 4c97aa131195; files: apps/android/app/src/main/java/ai/openclaw/app/ui/SessionsScreen.kt, apps/android/app/src/main/java/ai/openclaw/app/MainViewModel.kt, apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (4 earlier review cycles)
  • reviewed 2026-07-06T20:42:11.355Z sha 3dc4a9d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-06T21:41:41.202Z sha c719803 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-06T23:13:29.087Z sha a39e60d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-07T00:19:10.512Z sha 1b2fa8c :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 6, 2026
@RomneyDa
RomneyDa force-pushed the codex/android-recent-sessions-stability branch from 3dc4a9d to c719803 Compare July 6, 2026 21:00
@Solvely-Colin
Solvely-Colin force-pushed the codex/android-recent-sessions-stability branch 4 times, most recently from ade8999 to 2e8e728 Compare July 7, 2026 00:01
@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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Jul 7, 2026
@Solvely-Colin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Refreshed the branch against current main and addressed the native i18n inventory rank-up item.

Proof:

  • Base: 2b3a985b116e2caad74346aac4b11c03b92993d8
  • Head: 2e8e728fd7d9851d5c4b8c76b2de155622da51d9
  • Local pnpm native:i18n:check -> native-app-i18n: entries=2815 changed=false
  • Local ./gradlew testPlayDebugUnitTest --tests ai.openclaw.app.ui.ShellScreenLogicTest -> passed
  • Local ./gradlew testPlayDebugUnitTest -> passed while checking the earlier transient Play test failure
  • GitHub CI on the final head: native-i18n, android-test-play, android-test-third-party, android-build-play, and checks-node-compact-small-whole-2 all passed
  • PR rollup: no pending checks, no failures, mergeable

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Solvely-Colin
Solvely-Colin force-pushed the codex/android-recent-sessions-stability branch from 2e8e728 to 1b2fa8c Compare July 7, 2026 00:10
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. labels Jul 7, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 7, 2026
@Solvely-Colin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated again after main advanced. The PR is now rebased onto the current base and the review-relevant checks are green on the final head.

Proof:

  • Base: 4c97aa1311951b4c3380d20dfc0549d9352c8ffa
  • Head: 1b2fa8cc6760212730d23f889544991acfe3e6e4
  • Local pnpm native:i18n:check -> native-app-i18n: entries=2830 changed=false
  • Local ./gradlew testPlayDebugUnitTest --tests ai.openclaw.app.ui.ShellScreenLogicTest -> passed
  • Local ./gradlew testThirdPartyDebugUnitTest --tests ai.openclaw.app.GatewayBootstrapAuthTest.refreshGatewayConnection_reconnectsSavedManualEndpointAfterDisconnect -> passed while checking the transient Android CI failure
  • Local node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt.session-lock.test.ts -> passed while checking the transient node shard failure
  • GitHub CI on the final head: native-i18n, android-test-play, android-test-third-party, android-build-play, checks-node-compact-small-whole-2, and rerun checks-node-compact-large-whole-1 all passed
  • PR rollup: no pending checks, no failures, mergeable

@Solvely-Colin
Solvely-Colin merged commit 82106a1 into main Jul 7, 2026
166 of 174 checks passed
@Solvely-Colin
Solvely-Colin deleted the codex/android-recent-sessions-stability branch July 7, 2026 01:20
steipete added a commit that referenced this pull request Jul 7, 2026
Formatting drift landed via #101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.
steipete added a commit that referenced this pull request Jul 7, 2026
Formatting drift landed via #101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.
steipete added a commit that referenced this pull request Jul 7, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via #101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the #100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via openclaw#101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the openclaw#100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(openclaw#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via openclaw#101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the openclaw#100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(openclaw#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via openclaw#101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the openclaw#100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(openclaw#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants