Repository navigation
refactor(ui): remove unreachable assistant message expanded flag - #124263
Conversation
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
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 3:47 PM ET / 19:47 UTC. ClawSweeper reviewWhat this changesThis PR removes an unreachable Merge readinessKeep 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 Review scores
Verification
How this fits togetherControl 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -9, Tests -108. Total -117 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…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
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
loadedvariant ofAssistantMessageExpansionStatestill carried anexpandedboolean 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 veryexpandedfield being removed here — solely to exceed the transport preview limit.Why This Change Was Made
Removed the
expandedfield from theloadedstate and the now-unreachable toggle branch inchat-transcript-projection.ts; the loader always transitions directly fromloadingtoloaded/error. Collapsed the component test's duplicatedexpanded: true/expanded: falsefixture 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 passedLC_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 passedLC_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 passednode 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--mode uncommitted) — clean, no accepted/actionable findings