Skip to content

fix(android): filter device and internal sessions from thread picker#99557

Merged
steipete merged 4 commits into
openclaw:mainfrom
ly85206559:fix/android-session-filters-ios-parity
Jul 3, 2026
Merged

fix(android): filter device and internal sessions from thread picker#99557
steipete merged 4 commits into
openclaw:mainfrom
ly85206559:fix/android-session-filters-ios-parity

Conversation

@ly85206559

@ly85206559 ly85206559 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Android's chat thread picker exposed transport/device and internal sessions such as agent:main:node-*, main aliases, and onboarding. Raw hidden sessions could also create a misleading All chip, while counting only recent visible sessions would hide All when valid older conversations existed.

Why This Change Was Made

  • Centralize selectable-session classification beside Android session-choice resolution, with the full iOS behavior table as parity coverage.
  • Filter before injecting the active session so a hidden current device session cannot reappear.
  • Derive the All affordance from undisplayed selectable sessions, not raw session count or only the 24-hour recent subset.
  • Preserve pinned main/current behavior and compact chips without adding parallel filtering paths.

User Impact

The picker now shows user-facing conversations only. Device, direct/internal, main-alias, and onboarding rows disappear; channel conversations remain selectable; and valid older sessions remain reachable through All.

Evidence

Exact head: 51a96cab192b560d9762d851e4728f97af705335

  • ANDROID_HOME=$HOME/Library/Android/sdk ./gradlew :app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.chat.SessionFiltersTest :app:assemblePlayDebug
  • node --import tsx scripts/native-app-i18n.ts check
  • Fresh Codex autoreview after fixing its stale-session navigation finding: no actionable findings.
  • Android 16 emulator connected to an isolated real Gateway seeded with synthetic main, device, onboarding, and channel sessions.
Before After
Before: picker shows Main, Device Node Proof, and Onboarding Proof After: picker shows only Main and Channel Proof

The screenshots contain synthetic session labels only. The candidate also removes the bogus All row caused solely by filtered internal sessions; focused tests preserve All when an undisplayed selectable conversation is stale or compacted.

@clawsweeper

clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 3:31 PM ET / 19:31 UTC.

Summary
The PR adds Android session-selection filtering and tests so chat thread chips hide device/internal/onboarding sessions while preserving selectable channel and stale conversations.

PR surface: Other +157. Total +157 across 4 files.

Reproducibility: yes. source-reproducible: seed Android chat sessions with main, agent device, onboarding, stale channel, and channel keys, then open the chat thread picker. Current main admits raw entries into choices, while the PR filters them and the inspected screenshots show the before/after UI result.

Review metrics: none identified.

Root-cause cluster
Relationship: canonical
Canonical: #99557
Summary: This PR is the focused canonical branch for the Android thread-picker session-filter slice split out of a broader closed umbrella PR.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

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:

  • none.

Risk before merge

  • [P1] Required CI was still in progress and mergeability was unknown at live inspection after a recent force-push, so the normal required-check and mergeability gates still need to settle before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused Android session-filter helper and tests after required checks and maintainer review clear; broader session-browser policy can stay separate if maintainers want it.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is identified; the remaining action is maintainer review plus the normal required-check and mergeability gate.

Security
Cleared: No concrete security or supply-chain concern was found; the diff changes Android UI filtering helper code, tests, and native i18n line metadata only.

Review details

Best possible solution:

Land the focused Android session-filter helper and tests after required checks and maintainer review clear; broader session-browser policy can stay separate if maintainers want it.

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

Yes, source-reproducible: seed Android chat sessions with main, agent device, onboarding, stale channel, and channel keys, then open the chat thread picker. Current main admits raw entries into choices, while the PR filters them and the inspected screenshots show the before/after UI result.

Is this the best way to solve the issue?

Yes. The shared SessionFilters classifier is the right layer because both Android picker call sites already flow through resolveSessionChoices, and it mirrors the existing iOS classifier instead of adding per-composable filtering policy.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded Android thread-picker correctness fix with visible UI impact but limited blast radius and no runtime outage or security impact.
  • 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 (screenshot): The PR body includes inspected before/after Android screenshots that directly show hidden device/onboarding chips disappearing while a channel chip remains, supplemented by focused Gradle test output.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes inspected before/after Android screenshots that directly show hidden device/onboarding chips disappearing while a channel chip remains, supplemented by focused Gradle test output.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes inspected before/after Android screenshots that directly show hidden device/onboarding chips disappearing while a channel chip remains, supplemented by focused Gradle test output.
Evidence reviewed

PR surface:

Other +157. Total +157 across 4 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 4 186 29 +157
Total 4 186 29 +157

What I checked:

Likely related people:

  • joshavant: Commit 2ef0d27 added the iOS isRecentChatSession classifier and tests that this Android PR explicitly mirrors. (role: sibling invariant introducer; confidence: high; commits: 2ef0d274faad; files: apps/ios/Sources/Design/CommandCenterTab.swift, apps/ios/Tests/CommandCenterTabSessionFilterTests.swift)
  • lixuankai: Merged PR feat(android): Multiple nodes session context isolated from each other #53752 introduced Android node-specific session key behavior and buildNodeMainSessionKey, which is directly related to the node-* keys filtered here. (role: adjacent session-key behavior contributor; confidence: medium; commits: f0a57fad42e1; files: apps/android/app/src/main/java/ai/openclaw/app/SessionKey.kt)
  • christopheraaronhogg: Commit ab2761f recently changed the Android ChatScreen chat-reader path adjacent to the thread switcher, making this a useful Android chat UI routing signal. (role: recent Android chat contributor; confidence: medium; commits: ab2761f3a59a; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt)
  • steipete: The live PR is assigned to steipete, and the latest PR-head commits tighten the filter and stale-session handling, so this is the strongest immediate review route. (role: current follow-up owner; confidence: high; commits: f2045d05ae37, 8ccda32148c8, 51a96cab192b; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/SessionFilters.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt, apps/android/app/src/test/java/ai/openclaw/app/ui/chat/SessionFiltersTest.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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 3, 2026
@ly85206559

Copy link
Copy Markdown
Contributor Author

Local proof (Windows)

Environment

  • Host: CONAN (Windows)
  • Branch HEAD: 48222962a9
  • JAVA_HOME: F:\Program Files\Android\Android Studio\jbr
  • ANDROID_HOME / ANDROID_SDK_ROOT: F:\Android\Sdk
  • GRADLE_USER_HOME: F:\Android\Sdk\.gradle

Command

cd d:\WorkSpace\AI\openclaw\.worktrees\android-session-filters-parity\apps\android
.\gradlew.bat :app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.chat.SessionFiltersTest

Result: BUILD SUCCESSFUL in 9m 27s (first Gradle/SDK warmup on this machine)

JUnit (SessionFiltersTest): 5 tests, 0 failures, 0 errors

  • sessionChoicesPreferMainAndRecent
  • sessionChoicesIncludeCurrentWhenMissing
  • compactChoicesKeepMainAndCurrentWhileCappingRecentSessions
  • sessionChoicesFilterAgentDeviceAndInternalSessions
  • isSelectableChatSession_matchesIosRecentSessionFilter

@ly85206559

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated PR body Evidence with local Windows Gradle proof (5/5 SessionFiltersTest, BUILD SUCCESSFUL). No code changes since last review — patch quality feedback accepted; UI screenshot proof is not included (unit tests cover the shared picker helper).

@clawsweeper

clawsweeper Bot commented Jul 3, 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.

@steipete steipete self-assigned this Jul 3, 2026
@steipete
steipete force-pushed the fix/android-session-filters-ios-parity branch from 4822296 to 8795a89 Compare July 3, 2026 19:16
@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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 3, 2026
ly85206559 and others added 4 commits July 3, 2026 20:26
Align SessionFilters with iOS isRecentChatSession so agent device sessions,
internal main aliases, and onboarding keys do not appear in recent choices.

Co-authored-by: Cursor <[email protected]>
@steipete
steipete force-pushed the fix/android-session-filters-ios-parity branch from 8795a89 to 51a96ca Compare July 3, 2026 19:26
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Land-ready maintainer proof for exact head 51a96cab192b560d9762d851e4728f97af705335:

  • Rebased and rewrote the base around one canonical Android session classifier matching the iOS behavior table.
  • Hidden active device sessions can no longer be injected back into the picker; channel conversations remain; All is absent for raw hidden-only sessions but retained for stale or compacted selectable conversations.
  • SessionFiltersTest, :app:assemblePlayDebug, and native i18n inventory check pass.
  • Fresh Codex autoreview initially found stale-session navigation loss; that was fixed, retested, and the final review has no actionable findings.
  • Exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/28679749424
  • Android 16 before/after used an isolated real Gateway seeded only with synthetic Main, Device Node Proof, Onboarding Proof, and Channel Proof sessions.
Before After
Before: picker shows Main, Device Node Proof, and Onboarding Proof After: picker shows only Main and Channel Proof

No known proof gap remains for the picker behavior.

@steipete
steipete merged commit 57d0747 into openclaw:main Jul 3, 2026
86 of 87 checks passed
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 4, 2026
…penclaw#99557)

* fix(android): filter device and internal sessions from thread picker

Align SessionFilters with iOS isRecentChatSession so agent device sessions,
internal main aliases, and onboarding keys do not appear in recent choices.

Co-authored-by: Cursor <[email protected]>

* fix(android): tighten chat session filtering

* fix(android): preserve access to stale chat sessions

* chore(android): sync native i18n inventory

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
@ly85206559
ly85206559 deleted the fix/android-session-filters-ios-parity branch July 6, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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