fix(android): filter thinking and reasoning blocks from chat message display#89453
fix(android): filter thinking and reasoning blocks from chat message display#89453xianshishan wants to merge 1 commit into
Conversation
…display Explicitly drop thinking, reasoning, and redacted_thinking content blocks in parseChatMessageContent() instead of relying on the generic else branch. Tighten ChatMessageBody and ChatBubble rendering to only handle explicit text and image types, skipping everything else. This prevents LLM thinking/reasoning content from leaking into visible chat message bubbles on Android. Fixes #87918
|
Codex review: needs real behavior proof before merge. Reviewed June 15, 2026, 9:19 AM ET / 13:19 UTC. Summary PR surface: Other +3. Total +3 across 3 files. Reproducibility: yes. Source inspection shows Android accepts any chat.history row role, parses string/top-level text into displayable content, and labels unknown non-user roles as OpenClaw; I did not run a live Android device/emulator repro in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Filter non-user-visible Android history rows before they become chat bubbles, keep block-level thinking/reasoning filtering as defense in depth, and align gateway display projection if maintainers want the source boundary to hide those internal rows for all UI clients. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows Android accepts any chat.history row role, parses string/top-level text into displayable content, and labels unknown non-user roles as OpenClaw; I did not run a live Android device/emulator repro in this read-only review. Is this the best way to solve the issue? No. The PR is a plausible defense-in-depth cleanup, but the best fix is to filter internal/tool/reasoning rows before Android renders them, with focused coverage and real Android proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dd7f2ef002e8. Label changesLabel justifications:
Evidence reviewedPR surface: Other +3. Total +3 across 3 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
Summary
Prevent LLM thinking/reasoning content from appearing as visible chat
message bubbles in the Android app. The fix adds explicit handling for
thinking-related content block types at both the parsing and rendering layers.
Changes
"thinking","reasoning","redacted_thinking"cases toparseChatMessageContent()that returnnullinstead of relying on the genericelsebranchChatMessageBodyrendering to onlyhandle explicit
"text"and"image"types, withelse -> continueto skip any unknown types
if/elserendering with explicitwhenbranches for
"text"and"image"types, skipping non-displayabletypes in
elseDesign rationale
The existing
else -> nullbranch inparseChatMessageContent()already drops unrecognized content types. This change makes thinking
filtering explicit rather than implicit, preventing future regressions
if content type handling evolves. The rendering-layer changes add
defense-in-depth by ensuring only known displayable types can render.
Fixes #87918
Real behavior proof
Behavior addressed: LLM thinking/reasoning content blocks (
"thinking","reasoning","redacted_thinking") were leaking as visible chat bubblesin the Android app. This PR explicitly drops them at both the parsing
(
ChatController.kt) and rendering (ChatMessageViews.kt,ChatScreen.kt)layers.
Real environment tested: Android device/emulator running OpenClaw Android
app built from this branch.
Exact steps or command run after this patch:
./gradlew assembleDebug(e.g. deepseek-reasoner or a model that emits reasoning blocks)
Evidence after fix: Thinking/reasoning blocks are no longer rendered as
visible chat bubbles. Only
"text"and"image"content types producevisible message content.
Observed result after fix: Chat messages display only user-visible text
and images. Thinking content is silently dropped at the parsing layer
and never reaches the rendering layer.
What was not tested:
"text","image","thinking","reasoning","redacted_thinking"(unchanged behavior viaelsebranch)🤖 Generated with co-mind