Skip to content

fix(ui): pool reply-less wake activity into one chat rollup - #128442

Merged
steipete merged 1 commit into
mainfrom
steipete/group-tideclaw-chat-5800c1
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/group-tideclaw-chat-5800c1

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sessions driven by recurring wakes (heartbeats, cron ticks) fill the Control UI transcript with a long stack of identical rows — e.g. dozens of Heartbeat Respond tool cards, one per wake, each rendered as its own transcript row with full group spacing. On a long-lived claw the chat becomes pages of repeated noise with no information gain (reported from stable.openclaw.ai/chat/tideclaw).

Why This Change Was Made

Each wake is its own run, and coalesceActivityRuns deliberately flushes activity rollups at run boundaries so one run's work stays in one response frame. That rule is right for runs that produce a reply, but for runs whose entire visible outcome is tool activity there is no response to frame — the per-run separation only produces repeated rows.

The fix keeps the run-ownership rule and adds one carve-out at the same owner (coalesceActivityRuns): consecutive activity groups from reply-less runs pool into a single expandable activity rollup. A run with any visible reply, stream, or live/streaming content keeps per-run separation exactly as before. The rollup label reuses the standalone row's tool display label via summarizeToolGroup, so six pooled wakes read "Used Heartbeat Respond ×6" instead of used heartbeat_respond ×6.

Mechanical follow-on: chat-thread-grouping.ts crossed the 700-line lint cap, so the tool call/result pairing block moved verbatim to chat-tool-activity-coalesce.ts (pure move, no behavior change).

User Impact

  • Heartbeat/cron-heavy transcripts collapse N identical wake rows into one row: Used Heartbeat Respond ×N ›, expandable to the individual cards.
  • Tool-name rollup summaries now use humanized display labels ("Used Mcp Linear" instead of "Used mcp__linear"), matching the standalone rows.
  • Runs with visible replies are unaffected; live runs stay expanded while working.

Evidence

  • Unit coverage: ui/src/pages/chat/chat-thread.test.ts — pools reply-less tool runs and heartbeat-shaped assistant tool activity; keeps runs separate when a run has a visible reply; keeps a live run's activity out of the pool. ui/src/lib/chat/tool-call-grouping.test.ts covers the humanized labels.
  • E2E (mock gateway + Playwright): ui/src/e2e/chat-heartbeat-activity-rollup.e2e.test.ts seeds six heartbeat wakes across six runs, asserts exactly one rollup row labeled Used Heartbeat Respond ×6, zero standalone tool rows collapsed, and six cards after expansion.
  • pnpm chat suites: 168 files / 3431 tests green; check:changed green (format, tsgo UI + core tests, oxlint, i18n, knip).
  • Autoreview (Codex gpt-5.6-sol, high): clean, no accepted findings.
  • Production LOC: net ≈ +64 (≈15 of that is the file-split import header; chat-tool-activity-coalesce.ts is a verbatim move of −291 lines from chat-thread-grouping.ts). Growth is the new reply-less-run pooling pass in the owning module.

Before/after screenshots below (mocked Control UI, deterministic gateway).

Consecutive runs whose entire visible outcome is tool activity (heartbeat
wakes, cron ticks) now collapse into a single expandable activity row
instead of stacking identical rows down the transcript. Runs with a
visible reply keep per-run activity separation. Group summaries reuse the
standalone row's tool display label, so the rollup reads
"Used Heartbeat Respond ×N". Splits tool call/result pairing out of
chat-thread-grouping.ts into chat-tool-activity-coalesce.ts (max-lines).
@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete

Copy link
Copy Markdown
Contributor Author

Visual proof (mocked Control UI, agent:main:dashboard session seeded with one replied turn plus six heartbeat wakes across six distinct runs):

Before — one row per wake:

heartbeat-rollup-before

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

Copy link
Copy Markdown
Contributor Author

After — one pooled rollup row, then expanded:

heartbeat-rollup-collapsed

heartbeat-rollup-expanded

@steipete
steipete marked this pull request as ready for review August 24, 2026 01:11
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 25, 2026, 11:49 PM ET / August 26, 2026, 03:49 UTC.

ClawSweeper review

What this changes

Pools consecutive reply-less tool-only wake runs into one expandable Control UI activity rollup and uses human-readable labels for generic tools.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: current main still separates tool activity at run boundaries, but this PR’s new reply test treats renderer-empty assistant text as a visible reply, leaving affected wake rows unpooled. The PR is maintainer-authored/labeled and needs that focused correction plus normal human review.

Priority: P3
Reviewed head: f2ac85f134032959f030e3e38fca4430773fee89

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong real-flow evidence and focused coverage support the main behavior, but the renderer-empty reply case is a P2 correctness gap.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: The ordinary contributor proof gate does not apply to this Member-authored PR; its supplied live-gateway comment nevertheless documents after-fix rollup growth and expansion, with mock-Gateway browser coverage as supplemental evidence.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor proof gate does not apply to this Member-authored PR; its supplied live-gateway comment nevertheless documents after-fix rollup growth and expansion, with mock-Gateway browser coverage as supplemental evidence.
Evidence reviewed 6 items Current-main behavior remains missing: Current main only collects tool-role groups and flushes when their run IDs differ, so it does not pool reply-less activity across wake runs.
Proposed owner boundary: The PR adds the reply-less eligibility predicate at the activity-rollup owner; it marks any non-empty assistant text as a reply before pooling.
Renderer-visible mismatch: Assistant bubbles render sanitized Markdown only when the display markdown is non-empty, while the rollup predicate relies on extracted text; the supplied live-proof comment explicitly reports renderer-empty assistant markup blocking pooling.
Findings 1 actionable finding [P2] Ignore renderer-empty assistant text when pooling
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-heartbeat-activity-rollup.e2e.test.ts

Result: FAIL (failed) — step 1 run node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-heartbeat-activity-rollup.e2e.test.ts: previous terminal command was still running after 30 seconds: "node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-heartbeat-activity-rollup.e2e.test.ts"

RUN  v4.1.10 /tmp/clawsweeper-live-proof-128442-9MdXaE/target

[vitest] still running with no output for 30000ms.

Assertions:

  • FAIL expect_output: pools consecutive reply-less heartbeat wakes into one expandable rollup

How this fits together

The Control UI turns Gateway transcript events into grouped chat rows, then coalesces completed run activity before rendering the transcript. This PR changes that presentation-stage coalescing for heartbeat and cron-like tool-only runs.

flowchart LR
A[Gateway transcript events] --> B[Chat item builder]
B --> C[Message grouping]
C --> D[Activity run coalescing]
D --> E[Transcript projection]
E --> F[Expandable Control UI rollup]
Loading

Before merge

  • Ignore renderer-empty assistant text when pooling (P2) - The new predicate treats any extracted assistant text as a reply. The supplied live-proof comment already identifies assistant text that renders to nothing yet blocks pooling, so these wake runs still produce the repeated standalone rows this PR is meant to remove. Classify reply presence from the displayed-content contract and add a regression for the renderer-empty shape.
  • Resolve merge risk (P1) - Current main changed adjacent chat build/grouping code after this head. GitHub reports a clean merge, but the final merge result still needs focused UI validation after the correction.

Findings

  • [P2] Ignore renderer-empty assistant text when pooling — ui/src/pages/chat/chat-thread-grouping.ts:413-414
Agent review details

Security

None.

PR surface

Source +64, Tests +163. Total +227 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 407 343 +64
Tests 3 169 6 +163
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 576 349 +227

Review metrics

Metric Value Why it matters
Production versus test LOC production +64, tests +163 The 291-line tool-pairing extraction is a pure move; the remaining production growth implements pooling, while the added tests cover the new transcript behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Define reply-less eligibility from the same user-visible text contract as the assistant bubble, so renderer-empty metadata does not prevent pooling while real text, media, streams, and live runs still remain separate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Define reply-less eligibility from the same user-visible text contract as the assistant bubble, so renderer-empty metadata does not prevent pooling while real text, media, streams, and live runs still remain separate.

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

Yes for the PR head: the new predicate marks renderer-empty assistant text as a reply, and the supplied live-proof comment reports that it keeps otherwise tool-only wake rows separate.

Is this the best way to solve the issue?

No. The pooling boundary should follow displayed reply content rather than raw extracted text, preserving the stated visible-reply invariant.

Full review comments:

  • [P2] Ignore renderer-empty assistant text when pooling — ui/src/pages/chat/chat-thread-grouping.ts:413-414
    The new predicate treats any extracted assistant text as a reply. The supplied live-proof comment already identifies assistant text that renders to nothing yet blocks pooling, so these wake runs still produce the repeated standalone rows this PR is meant to remove. Classify reply presence from the displayed-content contract and add a regression for the renderer-empty shape.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp. Replaced prior rating: 🐚 platinum hermit.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is not_applicable.

Label justifications:

  • P3: The PR improves Control UI transcript readability without changing runtime availability, delivery, auth, or persisted state.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp. Replaced prior rating: 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor proof gate does not apply to this Member-authored PR; its supplied live-gateway comment nevertheless documents after-fix rollup growth and expansion, with mock-Gateway browser coverage as supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the PR head and is attributed by current-main blame for the adjacent activity-coalescing surface. (role: introduced proposed behavior and recent adjacent contributor; confidence: high; commits: f2ac85f13403, 4048b57b7d25; files: ui/src/pages/chat/chat-thread-grouping.ts, ui/src/pages/chat/chat-thread.test.ts)

Rank-up moves

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

  • Use a displayed-content predicate for reply-less eligibility and add coverage for renderer-empty assistant markup with tool activity.
  • Revalidate the focused Control UI flow against the final merge result after updating the branch.

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 (3 earlier review cycles)
  • reviewed 2026-08-24T01:19:17.660Z sha f2ac85f :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T02:01:59.924Z sha f2ac85f :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T07:04:50.834Z sha f2ac85f :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Live proof (real gateway, real model, real heartbeat wakes)

Beyond the mock-gateway E2E in the PR body, this change is now verified on a live rig:

  • Isolated dev gateway (own OPENCLAW_STATE_DIR, port 19801) running this branch's pnpm build output, openai/gpt-5.6-luna, heartbeat every: 45s, target: "none".
  • The rig accumulated ~2,800 genuine heartbeat wakes (16,970 transcript events) over ~2 days — the same shape as the originally reported session: [OpenClaw heartbeat poll] user turns plus heartbeat_respond call/result pairs per run.
  • Live Control UI result (screenshot attached): the loaded history window renders one Used Heartbeat Respond ×125 rollup instead of 125 stacked rows. The rollup grew live (×120 → ×125) as new wakes completed during capture, and expanding it shows all 125 individual cards (DOM-verified toolRowCount: 125).
  • Boundaries behave as designed on real data: pools flush at the Context compacted divider (a ×3 segment sits after it); the newest turn stays exposed while a run is working; runs where the model emitted visible text (degraded-model </final> / &nbsp spam near the context cap) stay standalone per the one-run-one-response rule.

Observed non-blocking edge for a possible follow-up: assistant text that renders to nothing (e.g. literal </final> markup stripped by markdown) still marks its run as replied and blocks pooling. Clean tool-only wakes — the reported case — pool correctly.

On the ClawSweeper rank-up items: behind-main drift is advisory per repo policy; exact-head CI is green on f2ac85f and the native landing flow verifies the merge head. The production +64 LOC is the pooling pass in the owning module, justified in the PR body.

@clawsweeper re-review

hb-collapsed-centered

hb-after

@clawsweeper

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

Re-review progress:

@steipete steipete closed this Aug 26, 2026
@steipete steipete reopened this Aug 26, 2026
@steipete
steipete merged commit b545224 into main Aug 26, 2026
311 checks passed
@steipete
steipete deleted the steipete/group-tideclaw-chat-5800c1 branch August 26, 2026 04:15
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Consecutive runs whose entire visible outcome is tool activity (heartbeat
wakes, cron ticks) now collapse into a single expandable activity row
instead of stacking identical rows down the transcript. Runs with a
visible reply keep per-run activity separation. Group summaries reuse the
standalone row's tool display label, so the rollup reads
"Used Heartbeat Respond ×N". Splits tool call/result pairing out of
chat-thread-grouping.ts into chat-tool-activity-coalesce.ts (max-lines).
vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (24 commits)
  fix(gateway): reject rootless session permission modes (#128149)
  docs(memory): document shipped turn-taint propagation for network tool output (#129837)
  fix(ui): pool reply-less wake activity into one chat rollup (#128442)
  fix(package): prevent installs from deleting validated runtime assets (#129724)
  fix(nodes): approve silent initial node surfaces and name the pending surface approval (#129795)
  fix(backup): preserve configured agent state roots (#129773)
  fix(ui): own chat history issuance with a closed state machine (#129776)
  fix(cron): preserve cancellation reason after late finalization (#129331)
  fix(cron): prevent run waits from failing after clock changes (#129805)
  fix(telegram): route commentary through one frozen progress owner (#128259)
  fix(release): start approved VCR mirror recovery jobs (#129829)
  test: complete current-plugin-metadata-snapshot mock factories (#129791)
  test(telegram): remove duplicate reaction case (#129848)
  fix(channels): honor supported account reply-threading policies (#129679)
  refactor(cli): deduplicate lazy subcommand registration (#129351)
  fix(ai): report interrupted local-model streams instead of empty success (#129794)
  refactor(cli): consolidate Gateway fallback and hook ownership (#129802)
  fix(qa): reject token confidence lanes without executed evidence (#129830)
  fix(tui): fence session state and delayed actions (#129810)
  fix(control-ui): keep task progress full width on hover (#129832)
  ...
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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