Skip to content

feat(ui): make reasoning blocks collapsible - #117365

Closed
chernoff-code wants to merge 2 commits into
openclaw:mainfrom
chernoff-code:codex/collapsible-reasoning-ui
Closed

chernoff-code wants to merge 2 commits into
openclaw:mainfrom
chernoff-code:codex/collapsible-reasoning-ui

Conversation

@chernoff-code

@chernoff-code chernoff-code commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a Control UI problem where assistant reasoning is always expanded inline with the final answer. Long reasoning traces dominate the conversation, make the final response difficult to find, and can leave reasoning-only messages without a useful visual container.

Why This Change Was Made

Reasoning is rendered in a native collapsed <details> disclosure with a clear Reasoning summary and chevron. The final answer remains visible outside the disclosure.

Using the native disclosure element preserves keyboard behavior and accessibility semantics without introducing new state management. The change also handles reasoning-only messages and keeps reply actions limited to messages with replyable answer content.

Product Decision

Collapsed-by-default reasoning is intentional. The operator requested a ChatGPT-like transcript, verified the deployed Control UI behavior, and confirmed this as the desired default. A persisted preference is intentionally outside this focused presentation change.

User Impact

Control UI conversations read more like ChatGPT: answers stay prominent, while reasoning can be expanded on demand with mouse or keyboard. Existing reasoning content is preserved; only its default presentation changes.

Evidence

  • 152 focused component tests passed in ui/src/pages/chat/components/chat-message.test.ts.
  • Added coverage for collapsed-by-default rendering, expansion, reasoning-only messages, final-answer visibility, and reply-action behavior.
  • Added browser E2E assertions for disclosure expansion and answer visibility in ui/src/e2e/chat-message-actions.e2e.test.ts.
  • GitHub CI passed the Control UI checks, type checks, lint, and three of four browser E2E shards. The remaining E2E shard and checks-node-compact-small-2 were terminated in an unrelated shared TUI/PTY test group; the same infrastructure failure occurred on both independent PRs.
  • Full Docker/Control UI build completed successfully.
  • Live Gateway verification confirmed the served Control UI asset changed and the operator confirmed the deployed behavior works as intended.
  • Inspectable browser-proof request and product decision: feat(ui): make reasoning blocks collapsible #117365 (comment)
  • git diff --check passes against current origin/main.

Inspectable Browser Proof

The focused Playwright test passed against the built Control UI with OPENCLAW_CAPTURE_UI_PROOF=1 (1 file, 1 test). It explicitly enables reasoning for the fixture, verifies the disclosure is closed initially, opens it through the native summary, confirms the private reasoning becomes visible, and verifies the final answer remains outside the disclosure.

The proof files live on a separate fork branch so the official PR diff remains source-only.

@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 22, 2026, 1:54 AM ET / 05:54 UTC (Revision 18).

ClawSweeper review

What this changes

Makes Control UI reasoning blocks expandable and initially collapsed, keeps answers visible, and adds component and browser coverage.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: the per-block disclosure remains distinct useful work, with no blocking defect established in the introduced patch. The related merged visibility repair explicitly does not supersede it.

Priority: P3
Reviewed head: 08b784624a9adbbb00445999823699f291ce111d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with directly relevant visual proof and no established introduced correctness defect.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.
Evidence reviewed 11 items Pinned introduced change: The merge-base-to-head patch adds a native disclosure, retains the existing reasoning visibility gate and sanitized Markdown renderer, and allows reasoning-only bubbles. No config, storage, dependency, permission, or provider changes are introduced.
Owner boundary and callers: chat-message-group passes showReasoning into renderGroupedMessage; message-extract reads generic typed thinking blocks; the disclosure uses the existing sanitized Markdown output. This presentation change does not depend on the Codex harness or protocol.
Inspected visual proof: Both prepared screenshots linked from #117365 (comment) were inspected. They show the same answer visible with reasoning collapsed and expanded. The browser fixture supplies synthetic Gateway messages but exercises the actual UI disclosure; this directly proves the changed visual behavior, not provider or network behavior.
Findings None None.
Security None None.

How this fits together

The Control UI renders assistant messages received through the Gateway. Its message renderer separates reasoning from answer content and applies the existing reasoning-visibility setting before displaying either.

flowchart TD
  A[Gateway conversation messages] --> B[Message grouping]
  B --> C[Reasoning visibility setting]
  C --> D[Collapsed reasoning disclosure]
  B --> E[Visible final answer]
  D --> F[Expand or collapse reasoning]
Loading

Decision needed

Question Recommendation
Should enabled reasoning start collapsed per block, including when the user opens Worked? Adopt the per-block disclosure: Approve collapsed-by-default blocks and integrate them with the current Worked and full-message rendering paths.

Why: The contributor reports operator approval, while current UI tests expect enabled reasoning to appear when Worked opens; neither establishes maintainer acceptance of the additional disclosure.

Before merge

  • Resolve merge risk (P1) - Users who enabled reasoning would need an additional expansion action, including inside Worked; maintainer acceptance of this changed default remains unrecorded.
  • Complete next step (P2) - Resolve the current merge conflicts against the canonical message-body flow and validate the resulting reasoning and full-message recovery behavior.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +64, Tests +76. Total +140 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 77 13 +64
Tests 2 77 1 +76
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 154 14 +140

Review metrics

Metric Value Why it matters
Reasoning presentation default 1 changed default; 0 persisted settings added Enabled reasoning starts collapsed without changing stored preferences.
Production versus test growth Production net +64 lines; tests net +76 lines Production growth supplies the disclosure markup, styling, focus treatment, and reduced-motion behavior.

Merge-risk options

Maintainer options:

  1. Confirm the disclosure default (recommended)
    Accept the extra expansion step explicitly, then align the current visibility tests with that decision.
  2. Preserve visibility inside Worked
    Narrow the disclosure behavior so opening Worked still reveals enabled reasoning immediately.

Technical review

Best possible solution:

Use the native disclosure within the current canonical message-body flow, with an agreed default that complements Worked and preserves full-message recovery.

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

Not applicable as a feature request; the inspected browser screenshots directly demonstrate the proposed collapsed and expanded presentation.

Is this the best way to solve the issue?

Yes for the rendering mechanism: native details reuses browser interaction and existing sanitization without new state machinery. Its default and placement within the newer Worked flow still need agreement.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5171c37c9f77.

Labels

Label changes:

  • add P3: This is a bounded transcript-readability improvement without an established urgent runtime failure.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.
  • remove P2: Current review triage priority is P3, so this older priority label is no longer current.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a bounded transcript-readability improvement without an established urgent runtime failure.
  • merge-risk: 🚨 compatibility: The new collapsed default changes how existing users reveal enabled reasoning, especially within Worked.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected screenshots from the built Control UI show the changed message renderer collapsed and expanded with the answer visible; the browser scenario activates the native summary. Synthetic Gateway input does not undermine this directly visible presentation proof. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Record maintainer acceptance of the per-block collapsed default and its interaction with Worked.
  • Resolve current merge conflicts while preserving canonical message rendering, then refresh reasoning visibility and full-message recovery coverage.

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 (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T22:45:53.651Z sha 08b7846 :: found issues before merge. :: [P1] Preserve assistant full-message disclosure when rebasing
  • reviewed 2026-08-07T20:29:22.829Z sha 08b7846 :: found issues before merge. :: [P1] Compose reasoning with the current assistant disclosure
  • reviewed 2026-08-14T16:15:05.596Z sha 08b7846 :: found issues before merge. :: [P1] Rebase the disclosure onto the current assistant pipeline
  • reviewed August 15, 2026, 5:55 PM ET / 21:55 UTC sha unknown :: found issues before merge. :: [P1] Rebase without dropping the full-assistant-message path
  • reviewed 2026-08-19T06:15:20.367Z sha 08b7846 :: found issues before merge. :: [P1] Compose reasoning with the full-assistant-message path
  • reviewed 2026-08-25T06:32:24.139Z sha 08b7846 :: found issues before merge. :: [P1] Render reasoning through the full-assistant-message path
  • reviewed 2026-08-25T06:59:59.766Z sha 08b7846 :: needs historical verification review before merge. :: [P1] Compose the disclosure with full assistant rendering
  • reviewed 2026-09-02T03:13:55.198Z sha 08b7846 :: needs real behavior proof before merge. :: none

@chernoff-code

Copy link
Copy Markdown
Contributor Author

@openclaw-mantis web UI chat proof: verify that reasoning is collapsed by default, expands on activation, and leaves the final answer visible.

Product decision context: the operator explicitly requested a ChatGPT-like chat presentation with reasoning collapsed by default, verified the deployed Control UI behavior, and confirmed that this default is desired. A persisted preference is intentionally out of scope for this focused presentation change.

@chernoff-code

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@chernoff-code
chernoff-code force-pushed the codex/collapsible-reasoning-ui branch from dd98f12 to d6cf7ed Compare August 1, 2026 11:54

Copy link
Copy Markdown
Contributor Author

Browser proof is now inspectable and the focused Playwright run passes (1 file, 1 test).

Collapsed:

Reasoning collapsed

Expanded:

Reasoning expanded

The E2E fixture now explicitly enables reasoning for the active session and retains the current-main reply-preview privacy assertion.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 1, 2026
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Aug 25, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Sep 2, 2026
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. and removed 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. P2 Normal backlog priority with limited blast radius. labels Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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: 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.

1 participant