Skip to content

refactor(ui): remove unreachable assistant message expanded flag - #124263

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/assistant-expanded-dead-state
Aug 15, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/assistant-expanded-dead-state

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

Fixes #124235

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Loaded full assistant messages have rendered in full since #122207, but the loaded variant of AssistantMessageExpansionState still carried an expanded boolean and a toggle branch that flips it. Neither the automatic loader nor the exhausted-retry action can ever reach that branch, so the field and branch were dead code. The browser E2E for this surface also embedded an 8,000-plus character architectural essay — including a code sample of the very expanded field being removed here — solely to exceed the transport preview limit.

Why This Change Was Made

Removed the expanded field from the loaded state and the now-unreachable toggle branch in chat-transcript-projection.ts; the loader always transitions directly from loading to loaded/error. Collapsed the component test's duplicated expanded: true / expanded: false fixture variants, which had become identical scenarios once the field disappeared. Replaced the stale E2E fixture prose with a compact, deterministic Markdown sample (heading, list, code block, path reference, neutral filler) that still clears the 8,000-character transport preview limit. The revision-checked completion guard and the exhausted-retry action/lifecycle are unchanged.

User Impact

No behavior change. Loaded assistant messages continue to render in full automatically, and bounded automatic retry plus the exhausted-retry action continue to work exactly as before.

Evidence

  • LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-message.test.ts — 185 tests passed
  • LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-transcript-render.test.ts ui/src/pages/chat/chat-thread.test.ts — 177 tests passed
  • LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-message-actions.e2e.test.ts — 1 browser E2E passed
  • node scripts/check-changed.mjs -- ui/src/e2e/chat-message-actions.e2e.test.ts ui/src/pages/chat/chat-thread.ts ui/src/pages/chat/components/chat-message.test.ts ui/src/pages/chat/components/chat-transcript-projection.ts — passed format, dead-code, i18n, typecheck (core tests + UI), and lint lanes: https://github.com/openclaw/openclaw/actions/runs/31904137933
  • Autoreview (--mode uncommitted) — clean, no accepted/actionable findings
  • Production LOC: net -9 (chat-thread.ts +1/-1, chat-transcript-projection.ts +1/-10). Test LOC: net -108 (chat-message.test.ts +10/-20, chat-message-actions.e2e.test.ts +29/-127)

Loaded full assistant messages always render in full, so the loaded
state's expanded boolean and its toggle branch could never be reached
by the automatic loader or the exhausted-retry action. Drop the dead
field and branch, and shrink the browser E2E fixture from an
8,000-plus character architectural essay describing the removed field
to a compact deterministic Markdown sample that still exceeds the
transport preview limit.

Fixes #124235
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 15, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 15, 2026 19:41
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 15, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 3:47 PM ET / 19:47 UTC.

ClawSweeper review

What this changes

This PR removes an unreachable expanded field and toggle branch from Control UI assistant full-message loading, deduplicates tests, and replaces stale long E2E prose with a compact deterministic fixture.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. Current main still carries the unreachable loaded-state flag and toggle path, while this focused PR removes them without changing the established full-message load, retry, copy, or reply behavior.

Priority: P3
Reviewed head: b39ee332c5d6e7cc448c26c958160e2b9eb5f07a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused net-negative cleanup with source-consistent behavior preservation and retained browser coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, behavior-neutral refactor is not subject to the external contributor proof gate; the PR nevertheless supplies focused browser E2E results.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, behavior-neutral refactor is not subject to the external contributor proof gate; the PR nevertheless supplies focused browser E2E results.
Evidence reviewed 6 items Current-main dead state: Current main defines loaded with expanded, although the PR removes that field from the same in-memory load-state union.
Current-main reachability: The current projection toggles expanded only for an already loaded record, while the automatic caller invokes it only for missing or bounded-error states.
Rendered behavior is status-based: The message group and markdown resolver select full content whenever status is loaded; neither reads the boolean.
Findings None None.
Security None None.

How this fits together

Control UI fetches a complete assistant message when transcript transport data is truncated, then projects the load state into rendering and message actions. Loaded markdown feeds the chat bubble, Copy, Reply, retry UI, and the browser E2E scenario.

flowchart LR
A[Truncated transcript message] --> B[Full-message load state]
B --> C{Load outcome}
C -->|Loading or error| D[Preview and bounded retry]
C -->|Loaded| E[Full markdown]
E --> F[Chat bubble]
F --> G[Copy and reply actions]
Loading

Before merge

  • Complete next step (P2) - No actionable repair remains; this focused maintainer PR should continue through normal review and exact-head checks.
Agent review details

Security

None.

PR surface

Source -9, Tests -108. Total -117 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 2 11 -9
Tests 2 39 147 -108
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 41 158 -117

Review metrics

Metric Value Why it matters
Production vs test LOC production +2/-11 (net -9); tests +39/-147 (net -108) The cleanup reduces both runtime and test surface without adding a new product path.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #124235
Summary: This PR directly implements the open issue's requested removal of obsolete assistant-message expansion state.

Members:

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

Technical review

Best possible solution:

Land the simplified state model after the normal exact-head CI and mergeability check, preserving the existing automatic-load and exhausted-retry behavior.

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

Not applicable: this is a source-proven dead-state cleanup, and current rendering uses loaded status rather than the removed boolean.

Is this the best way to solve the issue?

Yes. Removing the unreachable producer state and its toggle branch is the narrowest owner-boundary fix; rendering and retry behavior remain covered by existing focused tests and the browser E2E.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a focused Control UI maintenance cleanup with no intended user-visible behavior change.
  • 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: This maintainer-authored, behavior-neutral refactor is not subject to the external contributor proof gate; the PR nevertheless supplies focused browser E2E results.

Label justifications:

  • P3: This is a focused Control UI maintenance cleanup with no intended user-visible behavior change.
  • 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: This maintainer-authored, behavior-neutral refactor is not subject to the external contributor proof gate; the PR nevertheless supplies focused browser E2E results.

Evidence

What I checked:

Likely related people:

  • vyctorbrzezowski: Authored the merged full assistant-response behavior and this follow-up cleanup. (role: introduced the full-message UI behavior; confidence: high; commits: ce466fccb0c5, b39ee332c5d6; files: ui/src/pages/chat/components/chat-message-group.ts, ui/src/pages/chat/components/chat-message-markdown.ts, ui/src/e2e/chat-message-actions.e2e.test.ts)
  • steipete: Authored the earlier truncated-assistant-message feature and an adjacent action-alignment repair. (role: feature origin and adjacent UI contributor; confidence: medium; commits: de0fa7c2084c, aeaaaad4d045; files: ui/src/pages/chat/components/chat-message-group.ts, ui/src/pages/chat/components/chat-message-markdown.ts)

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.

@vyctorbrzezowski
vyctorbrzezowski merged commit 73c4582 into main Aug 15, 2026
223 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/assistant-expanded-dead-state branch August 15, 2026 21:15
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…nclaw#124263)

Loaded full assistant messages always render in full, so the loaded
state's expanded boolean and its toggle branch could never be reached
by the automatic loader or the exhausted-retry action. Drop the dead
field and branch, and shrink the browser E2E fixture from an
8,000-plus character architectural essay describing the removed field
to a compact deterministic Markdown sample that still exceeds the
transport preview limit.

Fixes openclaw#124235
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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.

Remove obsolete assistant-message expanded state and shrink its E2E fixture

1 participant