Skip to content

refactor(control-ui): group tool activity in the chat transcript - #124123

Closed
vyctorbrzezowski wants to merge 1 commit into
mainfrom
brzezowski/control-ui-tool-activity-groups
Closed

vyctorbrzezowski wants to merge 1 commit into
mainfrom
brzezowski/control-ui-tool-activity-groups

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

#125240 replaced the Control UI's old tool-card styling with lightweight transcript activity, but the transcript still had two competing grouping paths: collapseCompletedTurnWork produced a separate Worked for … rollup while coalesceActivityRuns produced semantic activity summaries. Mixed assistant text plus tool calls could also normalize into the tool role and disappear inside a collapsed disclosure.

Live lifecycle gaps compounded the readability problem: orphan progress could create a row with no outcome, terminal runs could leave unresolved calls in an unknown state, and bounded command output retained the oldest text instead of the most recent result.

Why This Change Was Made

This rewrite starts from current main and keeps #125240's lightweight presentation. The transcript projection is now the only disclosure owner:

  • contiguous pure tool/reasoning work becomes one semantic activity run;
  • singleton tool rows stay lightweight and direct;
  • assistant text, attachments, canvas/media, user turns, dividers, and search results remain outside activity disclosures;
  • the obsolete work-group projection, renderer, CSS, i18n, and tests are removed.

The live tool producer now validates phases and targets before sequence fencing, drops orphan progress while retaining orphan results, records unresolved calls as interrupted whenever their exact owning run terminates, and keeps the newest 120,000 characters only for command-like output. Read/fetch output retains the existing prefix behavior.

No Gateway protocol, config, or storage changes are included.

User Impact

  • Completed work reads as Ran 2 commands, read a file, edited a file… instead of Worked for 5s.
  • Final replies and visible artifacts never move inside tool detail.
  • Interrupted tools remain visibly marked rather than silently becoming unknown.
  • Malformed/orphan progress no longer creates permanent activity rows or poisons later valid events.
  • Long command output preserves the newest diagnostic lines.

Production delta: +271 / -294 (-23 net). Test delta: +426 / -315 (+111 net). Tooling ratchet: -1 stale baseline entry.

Evidence

Pre-fix focused regressions failed for mixed reply/tool grouping, orphan progress, command-tail truncation, and interrupted tool state. The same cases pass after the owner-boundary repair.

  • node scripts/run-vitest.mjs ui/src/lib/chat/message-normalizer.test.ts ui/src/pages/chat/chat-thread.test.ts ui/src/pages/chat/tool-stream.node.test.ts ui/src/pages/chat/run-lifecycle.test.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/chat/components/chat-message.test.ts ui/src/pages/chat/components/chat-tool-cards.node.test.ts — 774 passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-tool-turn-outcome.e2e.test.ts --reporter=verbose — 6 passed in Chromium against the mocked Gateway.
  • node scripts/check-changed.mjs -- <changed paths> — formatting, ratchets, deadcode, i18n, typecheck, oxlint, stylelint, and script checks passed.
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted … — clean; no accepted/actionable findings.

Recorder verdict:

{
  "workRollups": 0,
  "activityGroups": 2,
  "expandedSummary": "Ran 2 commands, read a file, edited a file, used web_search",
  "finalReplyInsideActivity": false
}
Active tool work Completed, collapsed Completed, expanded
Active semantic activity Completed semantic activity Expanded lightweight activity

@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 15, 2026
@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: XL maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 6:46 AM ET / 10:46 UTC.

ClawSweeper review

What this changes

The branch replaces completed-turn work rollups with semantic Control UI activity disclosures and records interrupted live tool calls.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this maintainer-owned draft open. Two previously reported P2 correctness blockers remain on the unchanged head, and current main has substantially rewritten the same transcript surface, so the branch needs a deliberate rebase rather than merge consideration.

Priority: P2
Reviewed head: fc0036e17255c06b6b42022b302776afc83ee4ed

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The branch has useful, well-scoped intent and prior visual evidence, but two known correctness gaps and major current-main drift keep it below merge-ready.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable to the contributor-proof gate because the author is a repository MEMBER; the body nevertheless supplies mocked-Gateway tests and UI captures for the intended presentation.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to the contributor-proof gate because the author is a repository MEMBER; the body nevertheless supplies mocked-Gateway tests and UI captures for the intended presentation.
Evidence reviewed 6 items Command-bearing producer fact: The Codex integration emits commandBearing for dynamic tools, including arbitrary tool names whose arguments carry a command.
Dropped command classification: The introduced retention decision recomputes command status only from name and arguments and never preserves data.commandBearing in ToolStreamEntry.
Codex dynamic-tool contract: Direct sibling Codex inspection shows DynamicToolCallItem carries an arbitrary string tool name, so name-based classification cannot replace the producer fact. The sibling remote is an internal cache, so repository ownership is unverified.
Findings 2 actionable findings [P2] Preserve producer-marked command classification
[P2] Do not let hidden reasoning force a disclosure
Security None None.

How this fits together

The Control UI converts persisted messages and live tool events into transcript groups, then renders assistant replies and expandable tool activity. Run lifecycle state supplies the terminal outcome shown by those rows.

flowchart LR
  A[Chat and tool events] --> B[Message normalization]
  B --> C[Transcript grouping]
  C --> D[Activity disclosure]
  D --> E[Chat transcript]
  F[Run lifecycle] --> D
Loading

Before merge

  • Preserve producer-marked command classification (P2) - commandBearing is emitted for dynamically named Codex tools, but this new retention path recomputes the category from the name and a narrow argument heuristic. A command-bearing call with additional arguments is downgraded to generic output and retains its oldest bounded text instead of its terminal diagnostics. Carry the producer fact through ToolStreamEntry and cover a dynamic-name case.
  • Do not let hidden reasoning force a disclosure (P2) - Reasoning-only groups are appended to an activity run before rendering, even though showReasoning can be false. One visible tool plus hidden reasoning then becomes a multi-group disclosure rather than the direct singleton row promised by this PR. Base disclosure eligibility on visible groups and add the thinking-disabled regression.
  • Resolve merge risk (P1) - Current main has substantially rewritten the transcript composition and the PR is currently conflict-dirty; a mechanical rebase could reintroduce retired grouping behavior unless reconciled with the current run-frame owner.
  • Complete next step (P2) - Rebase onto current main, preserve commandBearing through the tool stream, and keep hidden reasoning from turning a singleton visible tool into a disclosure before merge.

Findings

  • [P2] Preserve producer-marked command classification — ui/src/pages/chat/tool-stream.ts:1101-1106
  • [P2] Do not let hidden reasoning force a disclosure — ui/src/pages/chat/chat-thread-grouping.ts:630-635
Agent review details

Security

None.

PR surface

Source -23, Tests +111, Other -1. Total +87 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 14 271 294 -23
Tests 7 426 315 +111
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 22 697 610 +87

Review metrics

Metric Value Why it matters
Production vs test delta production -23; tests +111; tooling -1 The refactor reduces production code overall while adding focused coverage, but the revised current-main architecture must still absorb the behavior safely.

Mantis proof suggestion

After the rebase, a web chat transcript capture would directly demonstrate that visible replies stay outside activity disclosures and singleton tool rows remain direct. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis verify the rebased Control UI chat transcript keeps a single visible tool row direct when reasoning is disabled and keeps assistant replies outside activity disclosures; return redacted evidence.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase the intended semantic activity behavior onto current main’s run-frame architecture, preserve producer-supplied command classification, and make disclosure eligibility depend on visible content.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase the intended semantic activity behavior onto current main’s run-frame architecture, preserve producer-supplied command classification, and make disclosure eligibility depend on visible content.

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

Yes, from source: a producer-marked dynamic command with additional arguments is downgraded at ui/src/pages/chat/tool-stream.ts:1101, and hidden reasoning plus one tool creates an activity disclosure through ui/src/pages/chat/chat-thread-grouping.ts:630.

Is this the best way to solve the issue?

No. The intended cleanup is coherent, but it must retain producer facts and use the already-computed reasoning visibility state; current main’s newer run-frame composition is the right integration point.

Full review comments:

  • [P2] Preserve producer-marked command classification — ui/src/pages/chat/tool-stream.ts:1101-1106
    commandBearing is emitted for dynamically named Codex tools, but this new retention path recomputes the category from the name and a narrow argument heuristic. A command-bearing call with additional arguments is downgraded to generic output and retains its oldest bounded text instead of its terminal diagnostics. Carry the producer fact through ToolStreamEntry and cover a dynamic-name case.
    Confidence: 0.98
  • [P2] Do not let hidden reasoning force a disclosure — ui/src/pages/chat/chat-thread-grouping.ts:630-635
    Reasoning-only groups are appended to an activity run before rendering, even though showReasoning can be false. One visible tool plus hidden reasoning then becomes a multi-group disclosure rather than the direct singleton row promised by this PR. Base disclosure eligibility on visible groups and add the thinking-disabled regression.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 73a73e5ffca7.

Labels

Label justifications:

  • P2: The outstanding defects can mispresent bounded command diagnostics or add unnecessary disclosures in the Control UI, with limited blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Not applicable to the contributor-proof gate because the author is a repository MEMBER; the body nevertheless supplies mocked-Gateway tests and UI captures for the intended presentation.

Evidence

What I checked:

Likely related people:

  • vyctorbrzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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.

  • Carry commandBearing through the live tool-stream entry and add a dynamically named command regression.
  • Test one tool plus reasoning with thinking disabled and keep the singleton tool row direct.
  • Rebase onto current main and rerun focused transcript and Control UI proof.

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-15T12:36:22.613Z sha f1f6322 :: needs changes before merge. :: [P1] Keep mixed assistant text outside collapsed activity groups
  • reviewed 2026-08-16T01:39:08.979Z sha 08f3b01 :: needs maintainer review before merge. :: none
  • reviewed August 15, 2026, 10:26 PM ET / August 16, 2026, 02:26 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T10:00:09.881Z sha fc0036e :: found issues before merge. :: [P2] Honor producer-marked command output
  • reviewed 2026-08-21T15:08:18.032Z sha fc0036e :: needs changes before merge. :: [P2] Honor the producer-marked command output
  • reviewed 2026-08-21T16:03:06.766Z sha fc0036e :: found issues before merge. :: [P2] Preserve producer-marked command classification
  • reviewed 2026-08-27T20:45:14.196Z sha fc0036e :: found issues before merge. :: [P2] Preserve producer-marked command classification | [P2] Exclude hidden reasoning from activity-disclosure decisions
  • reviewed 2026-08-27T21:32:56.239Z sha fc0036e :: found issues before merge. :: [P2] Preserve producer-marked command classification | [P2] Exclude hidden reasoning from activity-disclosure decisions

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Aug 15, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/control-ui-tool-activity-groups branch from f1f6322 to 08f3b01 Compare August 16, 2026 01:33
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. and removed P1 High-priority user-facing bug, regression, or broken workflow. 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 16, 2026
Replace the obsolete completed-turn work rollup with the current lightweight semantic activity projection. Keep replies and artifacts outside disclosures, record unresolved terminal tools as interrupted, reject orphan progress before sequence fencing, and retain the latest bounded command output.
@clawsweeper
clawsweeper force-pushed the brzezowski/control-ui-tool-activity-groups branch from 08f3b01 to fc0036e Compare August 18, 2026 09:51
@clawsweeper clawsweeper Bot added 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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Aug 18, 2026
@clawsweeper clawsweeper Bot removed 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. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. clawsweeper-recovery-stuck labels Aug 18, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 27, 2026
@RomneyDa
RomneyDa deleted the brzezowski/control-ui-tool-activity-groups branch October 22, 2026 00:09
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant