Skip to content

fix(android): hide internal chat history rows#100826

Merged
steipete merged 2 commits into
mainfrom
codex/android-history-visibility
Jul 6, 2026
Merged

fix(android): hide internal chat history rows#100826
steipete merged 2 commits into
mainfrom
codex/android-history-visibility

Conversation

@steipete

@steipete steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #87918. Android chat history accepted every gateway message role, so text-bearing toolResult or internal rows could be cached and rendered as normal OpenClaw chat bubbles.

Why This Change Was Made

The gateway display projection intentionally preserves some non-chat rows for richer clients such as Control UI, so globally deleting tool rows would regress those clients. Android now applies one normalized user-visible role contract (user, assistant, system, and projected custom) at live-history parsing, transcript-cache writes and reads, and the final renderer.

User Impact

Internal reasoning, tool-result payloads, and unknown internal roles no longer appear as Android chat messages or return from the offline transcript cache. User messages, assistant replies, system notices, and explicitly projected custom/plugin notices remain visible.

Evidence

  • Blacksmith Testbox tbx_01kwvdq979j6y6kf62z0t0mnep: ChatControllerMessageIdentityTest and RoomChatTranscriptCacheTest passed.
  • Native i18n inventory check passed after the final rebase.
  • Fresh high-effort autoreview accepted the visible-custom compatibility finding, then completed clean at confidence 0.96.
  • Physical Android screenshot validation remains unavailable in this environment; the changed live-history and cache paths are covered at their production seams.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: S maintainer Maintainer-authored PR labels Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 7:15 AM ET / 11:15 UTC.

Summary
The PR adds an Android-visible chat role normalizer and applies it to live chat.history parsing, offline transcript cache reads/writes, and final message rendering, with focused Android regression tests and i18n inventory updates.

PR surface: Docs +2, Other +75. Total +77 across 8 files.

Reproducibility: yes. Source inspection on current main shows a chat.history row with a non-visible role and text content is parsed, cached, and rendered as an OpenClaw chat bubble.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: persistent cache schema: apps/android/CHANGELOG.md, persistent cache schema: apps/android/app/src/test/java/ai/openclaw/app/chat/RoomChatTranscriptCacheTest.kt. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #87918
Summary: This PR is the active candidate fix for the canonical Android internal reasoning/tool-row visibility issue; earlier block-only PRs were closed unmerged as partial fixes, and the optimistic-send PR is adjacent rather than the same root cause.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
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:

  • [P2] Resolve the current failing required CI jobs or show they are unrelated to this Android diff.
  • [P2] Consider adding redacted Android emulator/device proof if maintainers want visible UI evidence for the security-sensitive fix.

Risk before merge

  • [P1] Current exact-head CI is unstable with several failed non-Android checks; I did not trace those failures to the Android diff, but required checks still need resolution before merge.
  • [P1] The PR body reports Testbox seam coverage and says physical Android screenshot validation was unavailable, so maintainers may still want device/emulator proof before landing a security-sensitive visible-UI fix.

Maintainer options:

  1. Decide the mitigation before merge
    Land the Android-side visible-role contract after required CI and maintainer/security review, while keeping gateway projection behavior for richer clients unless a separate cross-client policy change is approved.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] This is already an open implementation PR for a protected maintainer-labeled, security-sensitive Android bug; the next action is maintainer/security review plus CI resolution, not an automated replacement PR.

Security
Cleared: Cleared: the diff narrows Android exposure of internal/tool rows and does not touch dependencies, workflows, credentials, package metadata, or other code-execution surfaces.

Review details

Best possible solution:

Land the Android-side visible-role contract after required CI and maintainer/security review, while keeping gateway projection behavior for richer clients unless a separate cross-client policy change is approved.

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

Yes. Source inspection on current main shows a chat.history row with a non-visible role and text content is parsed, cached, and rendered as an OpenClaw chat bubble.

Is this the best way to solve the issue?

Yes. The PR fixes the Android client boundary at live history parsing, offline cache read/write, and final rendering while avoiding a global gateway deletion that could regress richer history clients.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The PR targets a current Android chat leak of internal reasoning/tool details that can affect real users and is linked to an open security-impact issue.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable as a contributor proof gate because the PR is maintainer-labeled; the body includes Testbox seam-test evidence but no physical Android screenshot or recording.

Label justifications:

  • P1: The PR targets a current Android chat leak of internal reasoning/tool details that can affect real users and is linked to an open security-impact issue.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable as a contributor proof gate because the PR is maintainer-labeled; the body includes Testbox seam-test evidence but no physical Android screenshot or recording.
Evidence reviewed

PR surface:

Docs +2, Other +75. Total +77 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 7 93 18 +75
Total 8 95 18 +77

What I checked:

Likely related people:

  • LeonidasLux: Current blame for the Android parser, content parser, message renderer, and transcript-cache rows points to merged commit 0f01930 from PR fix(plugins): discover config load.paths plugins when index has entries #99196. (role: introduced current Android chat surface; confidence: high; commits: 0f01930c8eeb; files: apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageViews.kt, apps/android/app/src/main/java/ai/openclaw/app/chat/ChatTranscriptCache.kt)
  • vincentkoc: Live PR metadata shows vincentkoc merged PR fix(plugins): discover config load.paths plugins when index has entries #99196, whose commit currently owns the affected Android chat lines. (role: merger/reviewer of current Android file shape; confidence: medium; commits: 0f01930c8eeb; files: apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageViews.kt, apps/android/app/src/main/java/ai/openclaw/app/chat/ChatTranscriptCache.kt)
  • steipete: Commit b4b1984 recently touched Android ChatController for managed-worktree chat sessions, and this person owns the current PR plus nearby gateway/chat-history work. (role: recent adjacent chat contributor; confidence: medium; commits: b4b1984fe7a9, 15201f2dfec2; files: apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt, src/gateway/server-methods/chat.ts, src/gateway/chat-display-projection.ts)
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: 🐚 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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 6, 2026
@steipete
steipete force-pushed the codex/android-history-visibility branch from 15201f2 to 8b47af3 Compare July 6, 2026 11:19
@blacksmith-sh

This comment has been minimized.

@steipete
steipete force-pushed the codex/android-history-visibility branch from 8b47af3 to b8eab43 Compare July 6, 2026 11:24
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready review complete for head b8eab4361088b6268407d7ac6066cf7189d2e775.

  • Fresh autoreview: clean; no accepted/actionable findings.
  • Blacksmith Testbox tbx_01kwvdq979j6y6kf62z0t0mnep: focused chat history/cache suites and the complete 954-test third-party Android suite passed on the exact prepared tree without build cache.
  • Hosted CI run 28788052269: the full exact-head workflow passed, including Android Play/third-party tests, Android Play build, native i18n, production types, and QA smoke.
  • Review artifacts validate with zero findings; the PR remains an eight-file Android-only diff.

The fix applies one visible-role policy at live history ingestion, cache write/read, and final rendering. It drops internal/tool-result rows while retaining normalized user, assistant, system, and gateway-projected custom notices. Physical-device proof remains unavailable for this specific behavior because no deterministic gateway fixture emits internal-role history rows.

@steipete
steipete merged commit 90e1ef1 into main Jul 6, 2026
75 checks passed
@steipete
steipete deleted the codex/android-history-visibility branch July 6, 2026 11:37
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
* fix(android): hide internal chat history rows

* chore(android): sync native i18n inventory
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
* fix(android): hide internal chat history rows

* chore(android): sync native i18n inventory
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 P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

Android: LLM thinking/reasoning blocks rendered as separate chat messages

1 participant