Skip to content

perf(ui): stop re-parsing loaded tool output on every history page - #160030

Merged
steipete merged 4 commits into
mainfrom
steipete/tool-card-cache
Sep 28, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/tool-card-cache

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: scrolling up through a long chat stalls each time an older page of history loads. The stall grows with the history already loaded, because every rebuild re-parsed the tool output of every loaded message.

User Impact

User impact: loading older history in long chats does less main-thread work per page, so scrolling up through tool-heavy sessions stutters less, most visibly on slower machines. Nothing changes visually or functionally.

Why This Change Was Made

Profiling history paging on a real 6,954-message session found safeParseJson at ~1.2 s per paging run, under tool-card and canvas-preview preparation. The caches for that work are identity-keyed, but three paths defeated them on every rebuild:

  • Per-block tool cards. readProjections in chat-tool-activity-coalesce.ts called extractToolCardsCached({ ...message, content: [raw] }), and that fresh envelope never hit the WeakMap. tool-cards.ts now owns extractToolBlockCardsCached(message, block), keyed on the original message and block. The anonymous-id fallback reuses whole-message cards and never caches synthesized envelopes.
  • Preview misses. extractChatMessagePreview (chat-thread-items.ts) cached nothing when a message had no canvas preview, which is true for most tool outputs, so their output was re-parsed on every rebuild. The complete result is now cached per message identity, including null.
  • Coalesced rows. The coalescer rebuilt its synthesized tool rows as fresh objects, so expansion-state sync re-extracted their cards each time. Finalized synthesized messages are now memoized per owner message and row key. Reuse requires identical ordered inputs: rendering key, identity, name, every contributing source message and block (including live and fallback sources), and the final content layout. Memoization runs only after assembly finishes. Item wrappers stay fresh because duplicate grouping mutates them. Per-owner maps are replaced each pass, so nothing accumulates.

Instrumentation confirmed that already-loaded history messages keep their object identity across page loads. Live tool-stream messages are rebuilt as new objects on every update (tool-stream.ts), never mutated in place, so identity is a valid cache key. A replaced message or block is re-extracted.

Evidence

Real 6,954-message session through the mocked Gateway with production paging; bundled Control UI; Chromium 1280×900; scrolling up with synthetic mouse gestures until all history is loaded. Main (dd628a54504f) and this branch were built alternately (main, branch, branch, main, main, branch), 3 runs per build, 63 older-page loads per side.

History paging main this PR
1×: per-page long tasks (median) 288 ms 184 ms (−36%, p < 0.001)
1×: long tasks per paging run (median) 1,047 ms 636 ms
1×: fps (median) 48.3 51.2 (p < 0.001)
4× CPU: per-page long tasks (median) 2,653 ms 2,122 ms (−20%, p = 0.05)
4× CPU: fps (median) 12.3 14.4 (p = 0.04)

In a follow-up profile, safeParseJson self time during page loads fell from ~710 ms to ~282 ms per run, and the expansion-sync path from ~375 ms to ~99 ms. Loaded-history scrolling was already ~59 fps at 1× and is unaffected.

Tests:

  • chat-tool-activity-coalesce.test.ts: new regressions. Rebuilding over the same sources, then with an older page prepended, prepares each tool output once and returns identical synthesized messages for unchanged bundles. Replacing a message or block invalidates only its bundle. The published messages are frozen to prove they are never mutated. Each case fails on main.
  • chat-thread.test.ts: the preview result, including a miss, is prepared once per message across rebuilds. It fails on main.
  • Test cost with node scripts/run-vitest.mjs run <file> --maxWorkers=1: chat-tool-activity-coalesce.test.ts 2.3 s wall (5 tests; new cases ~5–7 ms), chat-thread.test.ts 2.6 s wall (239 tests). No timers or sleeps.
  • 32 owner and sibling test files (728 tests) passed: history merge, snapshot store, message cache, chat thread and grouping, tool activity, tool cards, browser and source previews, live streams, canvas, and capped-reply recovery. Also pnpm tsgo:ui, oxlint, oxfmt, and git diff --check.
  • An independent Codex review of each commit, then of the combined branch, came back scoped-clean.

Production lines: +101 / −10. The growth is the identity-keyed caches and the explicit memo inputs for synthesized rows. The inputs are listed out on purpose, because an omitted input is how a cache like this goes stale.

Reuse tool cards by original message and block identities while paging loaded chat history. Preserve anonymous matching through the whole-message owner and reuse its prepared cards for projections. Live tool updates already replace message and block snapshots.
Retain canvas preview results, including absent previews, by immutable source message identity. Older-page merging already preserves loaded objects; the uncached text-preview fallback repeated work despite whole-message tool-card cache hits. Preserve existing history, snapshot persistence, and replacement behavior.
Memoize completed tool activity messages by original source and block identities, rendering decisions, and final content layout. Finish bundle assembly before cache publication and keep item wrappers fresh for duplicate grouping. This lets unchanged synthesized rows reuse tool-card preparation across history pages.
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 28, 2026 02:02
@steipete steipete self-assigned this Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 10:08 PM ET / September 28, 2026, 02:08 UTC.

ClawSweeper review

What this changes

The Control UI caches tool-card extraction and absent canvas previews by source identity and reuses completed tool rows when older chat history loads.

Merge readiness

✅ Ready for maintainer review

The current main still repeats tool-output preparation during history paging. This PR addresses that work through the existing Control UI owners, and the reported browser measurements support a real improvement. I found no blocking defect in the introduced change.

Priority: P2
Reviewed head: 1530af733f34fe9b54d9e4ad819f17664c32bb18

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused cache changes, replacement tests, and measured browser behavior make this a strong review candidate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The changed preview, tool-card, and coalescing paths feed production history paging. The PR reports alternating Chromium runs through a mocked Gateway on a 6,954-message session, observing shorter page-load long tasks and less JSON parsing after the change. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The changed preview, tool-card, and coalescing paths feed production history paging. The PR reports alternating Chromium runs through a mocked Gateway on a 6,954-message session, observing shorter page-load long tasks and less JSON parsing after the change. No stored-data contract changes.
Evidence reviewed 7 items Introduced cache behavior: The PR adds a message-and-block cache around tool-card extraction, including the formerly uncached single-block path.
Preview and completed-row reuse: Preview misses are cached per message; completed coalesced messages are reused only when the recorded source inputs and final content layout match.
History identity lifecycle: Older-page merging keeps existing message objects, while the history publisher retains the projection's message identities.
Findings None None.
Security None None.

How this fits together

The Control UI receives chat history pages from the Gateway and prepares messages for the chat timeline. Tool-card extraction and activity coalescing turn tool output into the rows users see while scrolling.

flowchart LR
  A[Gateway history page] --> B[Retained chat messages]
  B --> C[Message and block identity]
  C --> D{Prepared result cached?}
  D -->|Yes| E[Reuse tool rows]
  D -->|No| F[Parse tool output]
  F --> E
  E --> G[Rendered chat timeline]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +91, Tests +161. Total +252 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 101 10 +91
Tests 2 161 0 +161
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 262 10 +252

Review metrics

Metric Value Why it matters
History paging long tasks 288 ms to 184 ms median per page at normal CPU speed The reported browser measurement directly covers the scrolling stall this PR targets.
Production and test growth production +101/−10 lines; tests +161 lines The PR body explains the production growth as cache state and explicit invalidation inputs.

Technical review

Best possible solution:

Keep parsing and row reuse with their existing Control UI owners, invalidating prepared results when a source snapshot changes.

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

Yes. Current-main source shows the repeated extraction path, and the PR reports a concrete long-session browser paging scenario; I did not execute current main.

Is this the best way to solve the issue?

Yes. Reusing results at the existing preview, tool-card, and coalescing owners is a focused repair for the repeated work, with replacement behavior covered by the added tests.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Long, tool-heavy chats can stutter during history paging, with limited impact outside that flow.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed preview, tool-card, and coalescing paths feed production history paging. The PR reports alternating Chromium runs through a mocked Gateway on a 6,954-message session, observing shorter page-load long tasks and less JSON parsing after the change. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The changed preview, tool-card, and coalescing paths feed production history paging. The PR reports alternating Chromium runs through a mocked Gateway on a 6,954-message session, observing shorter page-load long tasks and less JSON parsing after the change. No stored-data contract changes.

Label justifications:

  • P2: Long, tool-heavy chats can stutter during history paging, with limited impact outside that flow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The changed preview, tool-card, and coalescing paths feed production history paging. The PR reports alternating Chromium runs through a mocked Gateway on a 6,954-message session, observing shorter page-load long tasks and less JSON parsing after the change. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed preview, tool-card, and coalescing paths feed production history paging. The PR reports alternating Chromium runs through a mocked Gateway on a 6,954-message session, observing shorter page-load long tasks and less JSON parsing after the change. No stored-data contract changes.

Evidence

What I checked:

  • Introduced cache behavior: The PR adds a message-and-block cache around tool-card extraction, including the formerly uncached single-block path. (ui/src/lib/chat/tool-cards.ts:554, 1530af733f34)
  • Preview and completed-row reuse: Preview misses are cached per message; completed coalesced messages are reused only when the recorded source inputs and final content layout match. (ui/src/pages/chat/chat-tool-activity-coalesce.ts:463, 1530af733f34)
  • History identity lifecycle: Older-page merging keeps existing message objects, while the history publisher retains the projection's message identities. (ui/src/lib/chat/history-message-identity.ts:81, 1530af733f34)
  • Live update lifecycle: Live tool activity updates create a new displayed message snapshot, supporting identity-based invalidation. (ui/src/pages/chat/tool-stream.ts:549, 1530af733f34)
  • Current main still needs the change: The fetched main revision still extracts single-block cards through a fresh envelope and has no completed-row memoization; its affected files are unchanged from the pinned PR base. (ui/src/pages/chat/chat-tool-activity-coalesce.ts:129, 66679bfa3ec1)
  • Browser behavior proof: The captured PR body reports alternating main/branch Chromium paging runs on a 6,954-message session through a mocked Gateway: median per-page long tasks fell from 288 to 184 ms at normal CPU speed across 63 older-page loads per side. This is contributor-reported runtime evidence, not a reviewer rerun.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 1d7e5b0 into main Sep 28, 2026
166 checks passed
@steipete
steipete deleted the steipete/tool-card-cache branch September 28, 2026 02:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…penclaw#160030)

* perf(ui): cache tool activity block projections

Reuse tool cards by original message and block identities while paging loaded chat history. Preserve anonymous matching through the whole-message owner and reuse its prepared cards for projections. Live tool updates already replace message and block snapshots.

* perf(ui): cache chat preview misses across history pages

Retain canvas preview results, including absent previews, by immutable source message identity. Older-page merging already preserves loaded objects; the uncached text-preview fallback repeated work despite whole-message tool-card cache hits. Preserve existing history, snapshot persistence, and replacement behavior.

* perf(ui): retain finalized coalesced message identities

Memoize completed tool activity messages by original source and block identities, rendering decisions, and final content layout. Finish bundle assembly before cache publication and keep item wrappers fresh for duplicate grouping. This lets unchanged synthesized rows reuse tool-card preparation across history pages.
steipete added a commit that referenced this pull request Oct 26, 2026
)

* test(kilocode): deslop s1014 tests

Compact model fixtures and pricing assertions without deleting discovery behaviors. Retain advisory fallback, pricing conversion/fallback, malformed envelopes/rows, token limits, text-only and image-output filtering, duplicate recovery, and guarded-fetch policy assertions. The already-pruned suite remains below the requested 25% reduction rather than dropping distinct checks. CI-only validation: oxfmt, plain oxlint, and diff-check.

* test(kilocode): finish s1014 structural reduction

Replace the override builder with minimal shared chat and routing fixtures. Keep endpoint and exact SSRF policy assertions; remove internal call-count, audit-label and header-shape restatements. Shared provider-catalog-live-runtime tests cover transport behavior, including 'uses one timeout budget after a %i ms wall-clock step'.

The retained malformed-envelope case hits the same readRows rejection branch as the removed variant. 'parses gateway models with correct pricing conversion' and 'excludes image-output models while retaining chat and static routing entries' retain ordinary-chat inclusion; the duplicate-recovery case now focuses on malformed-first recovery. Preserve all 11 expanded cases and every distinct projection branch. Total shard: 204 to 152 lines. CI-only: oxfmt, plain oxlint and diff-check passed; no tests run.

* test(telegram): deslop s1018 tests

Deduplicate webhook request/response types and replace custom single-settlement bookkeeping with Promise settlement and finally cleanup. Preserve header-only auth probes, declared-length rejection, deterministic chunk writes, timeout diagnostics, and all caller assertions. No test cases removed; CI-only validation per campaign instructions.

* test(vydra): deslop s1017 tests

Simplify drip scheduling, inline the single-use server fixture, and compact response and URL fixtures. Preserve all eight cases and their distinct timeout, error metadata, body validation, idle-window, and URL traversal contracts. CI-only shard: plain oxlint and formatting/diff checks passed; runtime tests deferred to hosted CI.

* test(vydra): finish s1017 structural reduction

Localize drip-server lifetime and compact response fixtures while retaining timeout, body-error, empty-result, long-idle and URL traversal contracts. Remove the duplicate problem-JSON replay: extensions/xai/video-generation-transport.test.ts, rejects a successful problem JSON response as generated video, covers the same readProviderBinaryResponse MIME branch through downloadGeneratedVideoAsset. Original shard: 199 lines; final: 148 (-25.6%). Plain oxlint and formatting/diff checks passed; no test runs per CI-only mode.

* test(browser): deslop s1021 tests

Remove the HTTP response forwarding layer and simplify masked-frame construction without changing authentication assertions or wire data. All helper exports and caller tests remain intact.

* test(signal): deslop s1023 tests

* test(visitor-access): deslop s1019 tests

Compact policy fixtures and refusal tables while retaining all 25 cases. The dashboard update test retains exact mixed email/OIDC payload coverage formerly repeated by the renewal setup assertion. Preserve policy validation, mapping-change fencing, pagination, token redaction, and shutdown boundaries.

* test(visitor-access): consolidate s1019 client fixtures

Share reset client/fetch fixtures and exercise successful pagination in the dashboard-reread test. Keep duplicate discovery rejection separate. Remove the creation warm-up already covered by visitors.test.ts: invites the runtime-resolved numeric GitHub account and explains login. Preserve all policy-validation, redaction, mapping-change and shutdown boundaries. CI-only: formatting, plain oxlint and diff checks; no test runs.

* test(openai): deslop s1022 tests

Collapse terminal fixture options and completion waiters without removing status, socket reuse, or lifecycle cases. Keep tool delivery count and ordering; payload decoding remains covered by realtime-voice-bridge-events.test.ts (executes tool calls only from successful response output).

* test(openai): consolidate s1022 terminal outcome coverage

Fold successful tool ordering into the completed terminal row; keep every status branch and callback-failure recovery. Replace duplicated event/tool capture and exact message dumps with structured outcome assertions and an exact terminal callback trace.

Ordinary completed-response queue draining remains covered by realtime-voice-response-control.test.ts: serializes standalone control speech while an agent tool call is pending. Tool payload decoding remains covered by realtime-voice-bridge-events.test.ts: executes tool calls only from successful response output.

* test(voice-call): deslop s1024 tests

Consolidate PID/exit assertions, fixture path delivery, and startup timer capture. Keep all three real-process cases: auth-token argv isolation, forced shutdown, and cleanup before timeout rejection. The mocked tunnel.test.ts sibling does not replace these process-boundary checks.

* test(msteams): deslop s1025 tests

Reuse the existing Teams runtime fixture and trim feedback context setup. Preserve all six cases and every event, thread-routing, and authorization assertion. Remove unused message/reaction handler mocks; feedback invokes call authorization directly, not those handler factories.

* test(slack): deslop s1026 tests

* test(slack): consolidate s1026 retry scenarios

Retain all nine cases while sharing write setup and stream retry outcomes. Keep pending-cancellation retry/abort at the write owner, and retain start/append/stop retries plus the lost-acknowledgment branch.

Payload and state proof remains in streaming.test.ts: starts and appends supported structured stream chunks without buffering markdown text; does not resend committed text when finalization rejects after delivery. Workspace routing remains in client.web-api.test.ts: keeps lost stream responses one-shot without changing listener reads.

CI-only: plain oxlint, oxfmt, and git diff --check passed. No tests or coverage executed. Original shard 200 lines; final 150 lines.

* test(channels): deslop s1028 tests

Consolidate successful isolated-turn security and delivery proof in the retained bounded tool-free event case. Share replay assertions across successful and failed durable commits without removing either path.

* test(channels): trim s1028 fixture and assertion scaffolding

Retain outcome, replay, persistence, routing, event, timeout, and security assertions. Remove redundant mock counts and fixed job metadata checks, and share spy cleanup. Room metadata rendering remains covered by join-intro-prompt.test.ts: grounds unreadable room history in visible room facts and asks what the room needs.

* test(agents): deslop s1027 tests

* test(agents): simplify s1027 auth fixtures and redundant assertions

* test(agents): deslop o0001 tests

Consolidate cron assertions and collector failure fixtures. Remove redundant non-array wait inputs and copied dashboard metadata inventories.

Keep embedded history behavior in the real recalls-an-old-search-hit and preserves-continuation-facts tests; retain string-limit normalization in the byte-cap cases. Preserve authority, lifecycle, cursor and policy assertions.

CI-only: plain oxlint, oxfmt and diff checks passed. Static cases 293 to 288; shard lines 5869 to 5799. Remaining suites protect distinct boundaries, so the 20 percent target is not safely attainable.

* test(agents): remove redundant o0001 proof layers

Keep nested activity serialization in attempt-nested-tool-activity.test.ts and projection in agent-activity-events.test.ts. Native collector tests retain asynchronous cancellation and requester ownership; keep direct wait deadlines, registration races and delegated idempotency.

Keep PDF response coercion variants in image-tool.response.test.ts and pdf-tool.helpers.test.ts, and model discovery in pdf-tool.model-config.test.ts. Retain orchestration failure, Bedrock auth boundaries and model-policy lifecycle tests.

Keep visible creation registration in sessions-spawn-tool.test.ts. Drop duplicate internal Gateway option inventories and source invocation counts while retaining authority effects, receipts and revocation assertions. Keep Cron malformed updates in cron-tool.input.test.ts and list defaults in cron-tool.output-contract.test.ts.

CI-only: no tests run. Plain oxlint, oxfmt and diff checks passed. Shard 5869 to 5547 lines; 20 percent target remains unmet because retained cases protect distinct boundaries.

* test(agents): consolidate o0001 shared-owner fixtures

Exercise collector wait-loop ownership, coalescing and cancellation once through the tool adapter, retaining bridge completion/error/abort mapping. Canonicalize Gateway replacement checks before dispatch and after settlement in the bound request owner; creation retains provenance and option forwarding smoke.

Use per-test OpenClaw state for embedded history instead of hand-resetting session and FTS tables. Preserve projection drain and cleanup on failure through nested finally blocks.

CI-only: plain oxlint, oxfmt and diff checks passed; no tests run. Additional reduction 5547 to 5465 lines; cumulative 5869 to 5465. The 20 percent target remains unmet without discarding distinct boundary coverage.

* test(infra): deslop o0002 tests

Consolidate repeated lock identity and maintenance fixtures, fetch duplex and failure cases, sentinel payload setup, and empty stall reports. Retain all case inputs and distinct ownership, cleanup, compatibility, and error assertions.

* test(infra): consolidate o0002 boundary fixtures and duplicate layers

Keep exec completion delivery proof while terminal-resolution.test.ts owns length-stop notice generation (adds a length-stop notice only for partial text). Keep one fetch header integration case; fetch-headers.test.ts owns enumerability variants.

Remove repeated pooled-reader lifetime assertions covered by sqlite-readonly-worker.operations.test.ts (reuses workers across closed scopes without carrying database or inspection state; retires idle readers through IPC without waiting for broker termination grace) and retained auth restart/environment cases. Watch signal-loss propagation remains covered by the phase table and test/scripts/run-node-lifecycle.test.ts native runner/watch signal proof.

Consolidate lock, signal, runner and sentinel fixtures without dropping their distinct authority or cleanup assertions. CI-only: formatting, diff-check and plain oxlint pass; no tests run. Combined shard reduction is 5611 to 5172 lines (7.8%), below the requested 20 percent. No safe whole-file deletion identified.

* test(infra): share o0002 observation and lifecycle fixtures

Share existing and late-discovered auth reader fixtures while retaining caller-close, fallback refresh, held-refresh restart and retirement coverage. Table Gateway exit policies and persisted safe/unsafe rollback reader compatibility. Consolidate lock identity projection assertions without dropping exact namespace checks.

Preserve refresh-before-restart proof: the bundled-plugin-assets classifier test does not prove the watch runner invokes refresh each start. CI-only: plain oxlint, formatting and diff-check passed; no tests run. Shard total 5611 to 5091 lines (9.3 percent), still below 20 percent; no further safe deletion established.

* test(chat): deslop o0004 tests

Consolidate repeated header rendering and queue mutation setup, reuse the existing request assertion helpers, and remove an unreachable goal fixture branch. Preserve all cases and their distinct custody, privacy, replay, reconnect, and ordering assertions.

* test(chat): consolidate o0004 owner fixtures and branch tables

Merge pending notice and consumed-history cases into their owning branch tables. Share pane, rename, history, and attachment fixtures while retaining captured-owner, privacy, lifecycle, receipt, and ordering assertions.

Remove the ambiguous legacy-main duplicate covered by outbox-store.test.ts: derives badges and replay from the same migrated durable queue. Remove redundant Blob roundtrip assertions covered by outbox-blob-recovery.test.ts: stores attachment payloads without secure-context-only browser APIs. Parked menu membership remains covered by chat-header-session-menu.test.ts: reconciles parked owner membership and labels without replacing surviving rows.

Keep historical work-count regressions, including #160030 and #111539. CI-only static checks pass; tests and coverage not run. Original shard 5752 lines to 5323 lines (7.5 percent): short of the 20 percent target without removing distinct safety or regression proof.

* test(chat): remove duplicate o0004 presentation layers

Keep compaction and persisted-send variants at one owning branch table. Reuse pending-page, private-input, and async startup fixtures without changing their custody or lifecycle boundaries.

Retain observed-title proof in chat-pane-offline-metadata.test.ts: keeps the observed current title when startup precedes a bounded reconnect list. Retain offline inline rename there: queues a header rename and rendered reaction through the shared outbox. Native chat-header-session-menu-loading.test.tsx owns deferred header loading; chat-header-session-menu.test.ts owns parked membership reconciliation. Remove the obsolete idle-timer probe and duplicated layer assertions.

CI-only: plain oxlint, oxfmt and diff checks passed; no tests or builds run. Original shard5752 to5180 lines, 9.9 percent reduction. Still below20 percent; distinct privacy, CAS, receipt-source, captured-authority and interleaving contracts retained.

* test(agents): deslop o0003 tests

Consolidate repeated schema, provider policy, plugin config, CLI capture, and utility lease fixtures without removing distinct behaviors. Preserve authority, privacy, durability, prompt-prefix, and lifecycle ordering checks; these already-consolidated suites do not admit the requested 20% cut safely. CI-only: plain oxlint, oxfmt, and diff checks passed; runtime and coverage proof deferred to hosted CI.

* test: retain boundary proof and repair d582 fixture types

* test: retain caller, creation and attachment custody proof

* test: preserve routing, pagination and terminal payload contracts

* test: preserve worker and menu lifecycle proof

* test(signal): retain literal transport kinds in endpoint fixtures

* test: prune retired mock entries and retain request body typing
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…claw#184048)

* test(kilocode): deslop s1014 tests

Compact model fixtures and pricing assertions without deleting discovery behaviors. Retain advisory fallback, pricing conversion/fallback, malformed envelopes/rows, token limits, text-only and image-output filtering, duplicate recovery, and guarded-fetch policy assertions. The already-pruned suite remains below the requested 25% reduction rather than dropping distinct checks. CI-only validation: oxfmt, plain oxlint, and diff-check.

* test(kilocode): finish s1014 structural reduction

Replace the override builder with minimal shared chat and routing fixtures. Keep endpoint and exact SSRF policy assertions; remove internal call-count, audit-label and header-shape restatements. Shared provider-catalog-live-runtime tests cover transport behavior, including 'uses one timeout budget after a %i ms wall-clock step'.

The retained malformed-envelope case hits the same readRows rejection branch as the removed variant. 'parses gateway models with correct pricing conversion' and 'excludes image-output models while retaining chat and static routing entries' retain ordinary-chat inclusion; the duplicate-recovery case now focuses on malformed-first recovery. Preserve all 11 expanded cases and every distinct projection branch. Total shard: 204 to 152 lines. CI-only: oxfmt, plain oxlint and diff-check passed; no tests run.

* test(telegram): deslop s1018 tests

Deduplicate webhook request/response types and replace custom single-settlement bookkeeping with Promise settlement and finally cleanup. Preserve header-only auth probes, declared-length rejection, deterministic chunk writes, timeout diagnostics, and all caller assertions. No test cases removed; CI-only validation per campaign instructions.

* test(vydra): deslop s1017 tests

Simplify drip scheduling, inline the single-use server fixture, and compact response and URL fixtures. Preserve all eight cases and their distinct timeout, error metadata, body validation, idle-window, and URL traversal contracts. CI-only shard: plain oxlint and formatting/diff checks passed; runtime tests deferred to hosted CI.

* test(vydra): finish s1017 structural reduction

Localize drip-server lifetime and compact response fixtures while retaining timeout, body-error, empty-result, long-idle and URL traversal contracts. Remove the duplicate problem-JSON replay: extensions/xai/video-generation-transport.test.ts, rejects a successful problem JSON response as generated video, covers the same readProviderBinaryResponse MIME branch through downloadGeneratedVideoAsset. Original shard: 199 lines; final: 148 (-25.6%). Plain oxlint and formatting/diff checks passed; no test runs per CI-only mode.

* test(browser): deslop s1021 tests

Remove the HTTP response forwarding layer and simplify masked-frame construction without changing authentication assertions or wire data. All helper exports and caller tests remain intact.

* test(signal): deslop s1023 tests

* test(visitor-access): deslop s1019 tests

Compact policy fixtures and refusal tables while retaining all 25 cases. The dashboard update test retains exact mixed email/OIDC payload coverage formerly repeated by the renewal setup assertion. Preserve policy validation, mapping-change fencing, pagination, token redaction, and shutdown boundaries.

* test(visitor-access): consolidate s1019 client fixtures

Share reset client/fetch fixtures and exercise successful pagination in the dashboard-reread test. Keep duplicate discovery rejection separate. Remove the creation warm-up already covered by visitors.test.ts: invites the runtime-resolved numeric GitHub account and explains login. Preserve all policy-validation, redaction, mapping-change and shutdown boundaries. CI-only: formatting, plain oxlint and diff checks; no test runs.

* test(openai): deslop s1022 tests

Collapse terminal fixture options and completion waiters without removing status, socket reuse, or lifecycle cases. Keep tool delivery count and ordering; payload decoding remains covered by realtime-voice-bridge-events.test.ts (executes tool calls only from successful response output).

* test(openai): consolidate s1022 terminal outcome coverage

Fold successful tool ordering into the completed terminal row; keep every status branch and callback-failure recovery. Replace duplicated event/tool capture and exact message dumps with structured outcome assertions and an exact terminal callback trace.

Ordinary completed-response queue draining remains covered by realtime-voice-response-control.test.ts: serializes standalone control speech while an agent tool call is pending. Tool payload decoding remains covered by realtime-voice-bridge-events.test.ts: executes tool calls only from successful response output.

* test(voice-call): deslop s1024 tests

Consolidate PID/exit assertions, fixture path delivery, and startup timer capture. Keep all three real-process cases: auth-token argv isolation, forced shutdown, and cleanup before timeout rejection. The mocked tunnel.test.ts sibling does not replace these process-boundary checks.

* test(msteams): deslop s1025 tests

Reuse the existing Teams runtime fixture and trim feedback context setup. Preserve all six cases and every event, thread-routing, and authorization assertion. Remove unused message/reaction handler mocks; feedback invokes call authorization directly, not those handler factories.

* test(slack): deslop s1026 tests

* test(slack): consolidate s1026 retry scenarios

Retain all nine cases while sharing write setup and stream retry outcomes. Keep pending-cancellation retry/abort at the write owner, and retain start/append/stop retries plus the lost-acknowledgment branch.

Payload and state proof remains in streaming.test.ts: starts and appends supported structured stream chunks without buffering markdown text; does not resend committed text when finalization rejects after delivery. Workspace routing remains in client.web-api.test.ts: keeps lost stream responses one-shot without changing listener reads.

CI-only: plain oxlint, oxfmt, and git diff --check passed. No tests or coverage executed. Original shard 200 lines; final 150 lines.

* test(channels): deslop s1028 tests

Consolidate successful isolated-turn security and delivery proof in the retained bounded tool-free event case. Share replay assertions across successful and failed durable commits without removing either path.

* test(channels): trim s1028 fixture and assertion scaffolding

Retain outcome, replay, persistence, routing, event, timeout, and security assertions. Remove redundant mock counts and fixed job metadata checks, and share spy cleanup. Room metadata rendering remains covered by join-intro-prompt.test.ts: grounds unreadable room history in visible room facts and asks what the room needs.

* test(agents): deslop s1027 tests

* test(agents): simplify s1027 auth fixtures and redundant assertions

* test(agents): deslop o0001 tests

Consolidate cron assertions and collector failure fixtures. Remove redundant non-array wait inputs and copied dashboard metadata inventories.

Keep embedded history behavior in the real recalls-an-old-search-hit and preserves-continuation-facts tests; retain string-limit normalization in the byte-cap cases. Preserve authority, lifecycle, cursor and policy assertions.

CI-only: plain oxlint, oxfmt and diff checks passed. Static cases 293 to 288; shard lines 5869 to 5799. Remaining suites protect distinct boundaries, so the 20 percent target is not safely attainable.

* test(agents): remove redundant o0001 proof layers

Keep nested activity serialization in attempt-nested-tool-activity.test.ts and projection in agent-activity-events.test.ts. Native collector tests retain asynchronous cancellation and requester ownership; keep direct wait deadlines, registration races and delegated idempotency.

Keep PDF response coercion variants in image-tool.response.test.ts and pdf-tool.helpers.test.ts, and model discovery in pdf-tool.model-config.test.ts. Retain orchestration failure, Bedrock auth boundaries and model-policy lifecycle tests.

Keep visible creation registration in sessions-spawn-tool.test.ts. Drop duplicate internal Gateway option inventories and source invocation counts while retaining authority effects, receipts and revocation assertions. Keep Cron malformed updates in cron-tool.input.test.ts and list defaults in cron-tool.output-contract.test.ts.

CI-only: no tests run. Plain oxlint, oxfmt and diff checks passed. Shard 5869 to 5547 lines; 20 percent target remains unmet because retained cases protect distinct boundaries.

* test(agents): consolidate o0001 shared-owner fixtures

Exercise collector wait-loop ownership, coalescing and cancellation once through the tool adapter, retaining bridge completion/error/abort mapping. Canonicalize Gateway replacement checks before dispatch and after settlement in the bound request owner; creation retains provenance and option forwarding smoke.

Use per-test OpenClaw state for embedded history instead of hand-resetting session and FTS tables. Preserve projection drain and cleanup on failure through nested finally blocks.

CI-only: plain oxlint, oxfmt and diff checks passed; no tests run. Additional reduction 5547 to 5465 lines; cumulative 5869 to 5465. The 20 percent target remains unmet without discarding distinct boundary coverage.

* test(infra): deslop o0002 tests

Consolidate repeated lock identity and maintenance fixtures, fetch duplex and failure cases, sentinel payload setup, and empty stall reports. Retain all case inputs and distinct ownership, cleanup, compatibility, and error assertions.

* test(infra): consolidate o0002 boundary fixtures and duplicate layers

Keep exec completion delivery proof while terminal-resolution.test.ts owns length-stop notice generation (adds a length-stop notice only for partial text). Keep one fetch header integration case; fetch-headers.test.ts owns enumerability variants.

Remove repeated pooled-reader lifetime assertions covered by sqlite-readonly-worker.operations.test.ts (reuses workers across closed scopes without carrying database or inspection state; retires idle readers through IPC without waiting for broker termination grace) and retained auth restart/environment cases. Watch signal-loss propagation remains covered by the phase table and test/scripts/run-node-lifecycle.test.ts native runner/watch signal proof.

Consolidate lock, signal, runner and sentinel fixtures without dropping their distinct authority or cleanup assertions. CI-only: formatting, diff-check and plain oxlint pass; no tests run. Combined shard reduction is 5611 to 5172 lines (7.8%), below the requested 20 percent. No safe whole-file deletion identified.

* test(infra): share o0002 observation and lifecycle fixtures

Share existing and late-discovered auth reader fixtures while retaining caller-close, fallback refresh, held-refresh restart and retirement coverage. Table Gateway exit policies and persisted safe/unsafe rollback reader compatibility. Consolidate lock identity projection assertions without dropping exact namespace checks.

Preserve refresh-before-restart proof: the bundled-plugin-assets classifier test does not prove the watch runner invokes refresh each start. CI-only: plain oxlint, formatting and diff-check passed; no tests run. Shard total 5611 to 5091 lines (9.3 percent), still below 20 percent; no further safe deletion established.

* test(chat): deslop o0004 tests

Consolidate repeated header rendering and queue mutation setup, reuse the existing request assertion helpers, and remove an unreachable goal fixture branch. Preserve all cases and their distinct custody, privacy, replay, reconnect, and ordering assertions.

* test(chat): consolidate o0004 owner fixtures and branch tables

Merge pending notice and consumed-history cases into their owning branch tables. Share pane, rename, history, and attachment fixtures while retaining captured-owner, privacy, lifecycle, receipt, and ordering assertions.

Remove the ambiguous legacy-main duplicate covered by outbox-store.test.ts: derives badges and replay from the same migrated durable queue. Remove redundant Blob roundtrip assertions covered by outbox-blob-recovery.test.ts: stores attachment payloads without secure-context-only browser APIs. Parked menu membership remains covered by chat-header-session-menu.test.ts: reconciles parked owner membership and labels without replacing surviving rows.

Keep historical work-count regressions, including openclaw#160030 and openclaw#111539. CI-only static checks pass; tests and coverage not run. Original shard 5752 lines to 5323 lines (7.5 percent): short of the 20 percent target without removing distinct safety or regression proof.

* test(chat): remove duplicate o0004 presentation layers

Keep compaction and persisted-send variants at one owning branch table. Reuse pending-page, private-input, and async startup fixtures without changing their custody or lifecycle boundaries.

Retain observed-title proof in chat-pane-offline-metadata.test.ts: keeps the observed current title when startup precedes a bounded reconnect list. Retain offline inline rename there: queues a header rename and rendered reaction through the shared outbox. Native chat-header-session-menu-loading.test.tsx owns deferred header loading; chat-header-session-menu.test.ts owns parked membership reconciliation. Remove the obsolete idle-timer probe and duplicated layer assertions.

CI-only: plain oxlint, oxfmt and diff checks passed; no tests or builds run. Original shard5752 to5180 lines, 9.9 percent reduction. Still below20 percent; distinct privacy, CAS, receipt-source, captured-authority and interleaving contracts retained.

* test(agents): deslop o0003 tests

Consolidate repeated schema, provider policy, plugin config, CLI capture, and utility lease fixtures without removing distinct behaviors. Preserve authority, privacy, durability, prompt-prefix, and lifecycle ordering checks; these already-consolidated suites do not admit the requested 20% cut safely. CI-only: plain oxlint, oxfmt, and diff checks passed; runtime and coverage proof deferred to hosted CI.

* test: retain boundary proof and repair d582 fixture types

* test: retain caller, creation and attachment custody proof

* test: preserve routing, pagination and terminal payload contracts

* test: preserve worker and menu lifecycle proof

* test(signal): retain literal transport kinds in endpoint fixtures

* test: prune retired mock entries and retain request body typing
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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