Skip to content

fix(ui): simplify grouped tool activity#100318

Merged
steipete merged 1 commit into
mainfrom
fix/simplify-tool-activity
Jul 5, 2026
Merged

fix(ui): simplify grouped tool activity#100318
steipete merged 1 commit into
mainfrom
fix/simplify-tool-activity

Conversation

@steipete

@steipete steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Grouped tool activity is visually noisy: one logical execution can appear as separate call and result rows, alternating rows use different card backgrounds, and labels repeat in forms such as Bash bash or Heartbeat Respond heartbeat_respond. The group header also repeats the tool categories already visible below it.

Why This Change Was Made

This normalizes provider tool identifiers and coalesces only adjacent, matching call/result pairs into one logical execution. The merged row preserves expandable output, non-text content, error state, and canvas previews. Tool rows now use the normalized tool role for flat shell chrome, redundant summary text is suppressed after case/separator normalization, and the activity header shows only the execution count.

The broader normalization and regression coverage are intentional: provider payloads use several call-ID spellings, and collapsing rows without retaining those identities can hide output or merge unrelated events.

Implementation and review were AI-assisted with Codex under maintainer direction.

User Impact

Tool activity is easier to scan: one transparent row per logical execution, one consistent compact rhythm, no duplicated label/detail text, and no repeated category list in the header. Users can still expand each row to inspect input, output, media, canvas content, and real errors; recovered failures remain visually neutral.

Evidence

Before and after

Before After
Tool activity before redesign Tool activity after redesign

Verification

  • pnpm test ui/src/pages/chat/chat-thread.test.ts ui/src/pages/chat/components/chat-tool-cards.test.ts ui/src/pages/chat/components/chat-tool-cards.node.test.ts ui/src/pages/chat/components/chat-message.test.ts ui/src/pages/chat/chat-responsive.browser.test.ts — 5 files, 201 tests passed
  • pnpm ui:build — passed
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm check:changed -- <12 touched files> — passed
  • .agents/skills/autoreview/scripts/autoreview --mode local — clean; no accepted/actionable findings remain
  • Existing-profile Chrome inspection confirmed the original alternating 50 px card / 26 px row presentation and redundant labels. The synthetic after fixture renders four logical executions as four transparent 26 px rows.

Local Testbox was unavailable because this machine has neither the Blacksmith binary nor an AWS execution role. The repository-native prepare/landing flow will require exact-head hosted proof before merge.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Jul 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2fa982d97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +344 to +345
const resultContent = hasToolResultBlock
? resultOnlyContent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve result metadata when merging existing blocks

When a result message has array content with a tool_result block but keeps the call id/name on the top-level toolCallId/toolName fields, this branch copies the raw block and drops that metadata. extractToolCards accepts that shape before the merge, but the merged message is later re-extracted without resultMessage, so the result block no longer matches the call and renders as a second generic tool row instead of one coalesced execution. Enrich or synthesize the preserved result block with resultCard.callId/resultName before appending it.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 5, 2026, 9:52 AM ET / 13:52 UTC.

Summary
The PR normalizes Control UI tool identifiers, coalesces adjacent matching tool call/result activity rows, removes redundant tool labels/header preview text, and updates focused UI tests and styles.

PR surface: Source +133, Tests +376. Total +509 across 12 files.

Reproducibility: yes. Source inspection shows a result message with an existing tool_result block and top-level toolCallId/toolName passes the merge precheck, but the preserved raw block loses those fields after being appended to the assistant message.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: ui/src/pages/chat/chat-thread.test.ts, migration/backfill/repair: ui/src/pages/chat/components/chat-tool-cards.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit ✨ media proof bonus
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Preserve or synthesize result-block call id/name metadata and add a regression for top-level-only result metadata.

Mantis proof suggestion
A short browser proof would materially help confirm the compact grouped tool activity row still renders correctly after the metadata fix. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify grouped Control UI tool call/result activity renders as one compact expandable row with output preserved.

Risk before merge

  • [P1] Merging as-is can still show one logical tool execution as a coalesced call plus an extra generic tool result row for provider payloads whose result-block identity lives only at the result-message level.

Maintainer options:

  1. Decide the mitigation before merge
    Normalize preserved result blocks at the merge boundary so every coalesced execution retains call id, tool name, output, media, canvas previews, and error state under one compact expandable row.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] A narrow automated repair can preserve top-level result metadata when merging an existing result block and extend the new regression coverage for that shape.

Security
Cleared: No security or supply-chain sensitive files, dependency metadata, workflows, credentials, or package execution paths are changed.

Review findings

  • [P2] Preserve result metadata when reusing result blocks — ui/src/pages/chat/chat-thread.ts:344-345
Review details

Best possible solution:

Normalize preserved result blocks at the merge boundary so every coalesced execution retains call id, tool name, output, media, canvas previews, and error state under one compact expandable row.

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

Yes. Source inspection shows a result message with an existing tool_result block and top-level toolCallId/toolName passes the merge precheck, but the preserved raw block loses those fields after being appended to the assistant message.

Is this the best way to solve the issue?

No. The UI direction is reasonable, but the implementation is not the best fix until it enriches or synthesizes preserved result blocks before appending them.

Full review comments:

  • [P2] Preserve result metadata when reusing result blocks — ui/src/pages/chat/chat-thread.ts:344-345
    This previous blocker is still present on the current head. When the result message contains a tool_result block but keeps the call id/name only on top-level toolCallId/toolName, this branch copies the raw block into the merged assistant message. The merged message no longer has those top-level fields, so extractToolCards re-extracts the result as a second generic tool row instead of one coalesced execution; enrich the preserved block or synthesize a normalized result block before appending it.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.87

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes before/after screenshots for the visual UI change and live current-head proof checks are present, though they do not cover the remaining metadata edge case.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes before/after screenshots for the visual UI change and live current-head proof checks are present, though they do not cover the remaining metadata edge case.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The PR body includes before/after screenshots for the visual UI change and live current-head proof checks are present, though they do not cover the remaining metadata edge case.

Label justifications:

  • P2: The PR targets a normal-priority Control UI rendering bug with limited blast radius, but one source-reproducible display blocker remains.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The PR body includes before/after screenshots for the visual UI change and live current-head proof checks are present, though they do not cover the remaining metadata edge case.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes before/after screenshots for the visual UI change and live current-head proof checks are present, though they do not cover the remaining metadata edge case.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes before/after screenshots for the visual UI change and live current-head proof checks are present, though they do not cover the remaining metadata edge case.
Evidence reviewed

PR surface:

Source +133, Tests +376. Total +509 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 7 226 93 +133
Tests 5 391 15 +376
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 617 108 +509

Acceptance criteria:

  • [P1] pnpm test ui/src/pages/chat/chat-thread.test.ts ui/src/pages/chat/components/chat-tool-cards.node.test.ts ui/src/pages/chat/components/chat-message.test.ts.

What I checked:

  • Prior finding remains on current head: The current head still takes the hasToolResultBlock ? resultOnlyContent branch, which preserves raw existing result blocks without enriching them from resultCard.callId or resultName. (ui/src/pages/chat/chat-thread.ts:344, 2fe53aa2dcbe)
  • Re-extraction needs block-level identity once top-level metadata is gone: extractToolCards resolves result block id/name from the block or enclosing message; after the merge, the enclosing message is the assistant call message, so a raw result block without its own id/name becomes a separate generic tool card. (ui/src/lib/chat/tool-cards.ts:295, 2fe53aa2dcbe)
  • Regression coverage misses the top-level-only existing result-block shape: The new provider-shaped coalescing test covers a result block with its own tool_use_id, but not the still-broken case where the tool_result block lacks id/name and those fields live only on the result message. (ui/src/pages/chat/chat-thread.test.ts:213, 2fe53aa2dcbe)
  • Live PR state and proof context inspected: The PR body includes before/after screenshots and validation claims; live status shows current-head proof and CI jobs running or succeeding, but those do not cover the missing metadata edge case. (2fe53aa2dcbe)
  • Related UI history inspected: The nearby merged Control UI tool-row flattening work in improve(ui): flatten chat tool-call rows into a scannable list #99763 established the current compact-row direction that this PR builds on. (8909ebf6b1d7)

Likely related people:

  • steipete: Authored and merged the recent Control UI tool-call row flattening PR that this PR extends, and has direct recent history in the affected tool-card style/rendering surface beyond opening this PR. (role: recent Control UI tool-activity contributor; confidence: high; commits: 8909ebf6b1d7, 2fe53aa2dcbe; files: ui/src/pages/chat/components/chat-tool-cards.ts, ui/src/styles/chat/tool-cards.css, ui/src/styles/components.css)
  • vincentkoc: Local current-main blame for the checked-out Control UI chat-thread path points to the grafted current-main commit that carries the current implementation in this checkout. (role: current-main area contributor; confidence: low; commits: 5f2df2461970; files: ui/src/pages/chat/chat-thread.ts, ui/src/pages/chat/components/chat-message.ts, ui/src/lib/chat/tool-cards.ts)
  • harjothkhara: Authored the merged non-terminal tool-error grouping behavior in the same chat grouping/rendering area that this PR preserves with turnSucceeded. (role: adjacent grouped-render contributor; confidence: medium; commits: 13f63a1ce917; files: ui/src/ui/chat/build-chat-items.ts, ui/src/ui/chat/grouped-render.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-05T12:52:44.885Z sha e02a71f :: needs changes before merge. :: [P2] Preserve result identity when reusing result blocks

@steipete
steipete requested a review from a team as a code owner July 5, 2026 12:42
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: qqbot extensions: qa-lab extensions: codex extensions: copilot extensions: clawrouter Extension: clawrouter size: XL and removed size: L labels Jul 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: L and removed app: ios App: ios gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: qqbot extensions: qa-lab extensions: codex extensions: google extensions: copilot extensions: clawrouter Extension: clawrouter size: XL labels Jul 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Jul 5, 2026
@steipete
steipete merged commit a5fdc07 into main Jul 5, 2026
177 of 198 checks passed
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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