Skip to content

test(ui): decouple chat runtime budgets from Lit - #168348

Merged
steipete merged 3 commits into
mainfrom
solid2/p1-07
Oct 10, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/p1-07

Conversation

@steipete

@steipete steipete commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat runtime budgets patch Lit's requestUpdate, preventing the same performance tests from validating a different renderer.

User Impact

Internal test instrumentation only; no user-visible behavior change. Release-note context: preserve chat streaming and composer performance coverage through the Control UI renderer migration.

Why This Change Was Made

An opt-in RenderLifecycle hook reports accepted invalidations and completed DOM commits. The E2E probe owns the counters and frame attribution, replacing Lit prototype traversal and property-name diagnostics. Every existing numeric budget and workload size is unchanged.

Evidence

  • Codex autoreview: no actionable P0–P2 findings. The follow-up keeps the hook type private, documents its optional global, and uses a lint-compliant browser-hook name.
  • Latest budget E2E: 6/6 passed; pnpm test ui/src/e2e/chat-stream-runtime-budgets.e2e.test.ts --maxWorkers=1 took 44.5 s wall time on AWS Crabbox. Authoritative PR CI run 38038348799 passed on c62b2e07d67ca059bac84cbe684ededab4f6e42a. The budget file passed all six cases in 18.618 CI test-seconds; the selected E2E lane passed 18 cases across six files in 44.07 s (94 s whole-job wall time).
  • Full chat E2E: 214 files passed, 1 file failed; 1,130 cases passed and 2 failed, in 29m37.8s. This includes the real-Gateway cases. The subsequent changes are confined to instrumentation typing/naming and are covered by the latest budget run.
  • Latest scoped lint, styles, formatting, UI/core typechecks, and structural checks passed. check:changed remains red only for the baseline Gateway export described below.
  • AWS lease: cbx_3814c481387b. Full chat run: run_ee52102e2396087eab9a557d968c8c99. Latest budget/check run: run_c984063c0734e55ab651b9576d8e0b5b.
Metric Original Testbox baseline Latest AWS candidate
Stream invalidations / in-frame 2 / 2 2 / 2
Long-transcript load 653 ms 729 ms
Post-GC heap 26,313,772 bytes 26,265,312 bytes
Idle task time 39 ms 42 ms
Budget-file wall time 36.9 s 44.5 s

The baseline ran on Testbox and the final candidate on AWS; these timings are diagnostic only. The latest composer cases report zero invalidations and zero commits.

Inherited failures

The following failures occurred in remote pre-PR proof. They remain documented as inherited history; the authoritative PR CI run is green.

  • Catalog reconnect: the full chat run run_ee52102e2396087eab9a557d968c8c99 failed the reconnect and ordinary-reconnect cases in ui/src/e2e/chat-flow.catalog-bootstrap.e2e.test.ts (catalogRequests.size: expected 3, received 4). All eight cases pass in isolation on untouched baseline 7985ac28aaf5e in run_5aa9f32e1a3abf7bdd88f083a640ee51, and all eight pass on the candidate in run_414e47e1ebf58c6f15646629d51dc5b8. These are inherited order-dependent/flaky failures; the passing replays are evidence of isolation behavior, not a claimed fix.
  • Gateway unused export: the production dead-export scan reports src/gateway/control-ui-public-session-render.ts: PUBLIC_SESSION_ENTRY_SCRIPT. run_0d9dc0c4bf9556e27f7ae8a12423871e reproduces the same finding on untouched baseline 7985ac28aaf5e. Latest candidate run run_c984063c0734e55ab651b9576d8e0b5b reports only this inherited export; the instrumentation type/export and lint findings were fixed. This PR does not change the Gateway file.

No checks were disabled, budgets raised, or assertions weakened. The former active-turn recovery blocker passes after incorporating main's fix from #168195.

Report accepted invalidations and DOM commits through the renderer-neutral lifecycle test hook. Keep every numeric budget unchanged and retain counters in the E2E probe.

Release-note context: internal test instrumentation.
Keep the observer signature tied to the production notifier without exporting a test-only type, document the optional-global assertion, and use the browser hook naming convention.
@clawsweeper

clawsweeper Bot commented Oct 10, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces Lit prototype instrumentation with optional chat lifecycle notifications for performance tests.

Example: The browser performance test streams 240 chat deltas.

  • Before: The probe patches Lit requestUpdate to count host updates and attribute them to animation frames.
  • After: The probe counts accepted lifecycle invalidations and completed DOM commits without traversing Lit prototypes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused and apparently correct, with browser-harness validation; negative controls would strengthen confidence that the changed measurement preserves regression sensitivity.
Proof confidence 🦐 gold shrimp (3/6) Maintainer-authored internal instrumentation is supported by browser E2E results and verified exact-head CI; these are harness evidence, not a separate live deployment demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers cannot reuse the existing browser performance probe with another renderer because it patches Lit internals.
Reason: This focused change supports the renderer migration while retaining the existing workloads, thresholds, and behavioral assertions.

Merge readiness

✅ Ready for maintainer review

Keep this PR: it provides useful renderer-independent performance instrumentation, and source review found no concrete introduced defect.

Priority: P3
Reviewed head: c62b2e07d67ca059bac84cbe684ededab4f6e42a

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The earlier optional rank-up remains useful: demonstrate that removing stream-frame deduplication and restoring per-character composer invalidation still fail the updated budgets.
Agent review details

How this fits together

The chat controller connects state invalidation to rendering and post-commit effects; an optional browser test observer receives lifecycle notifications and records performance counters.

flowchart LR
  A[Gateway events and composer edits] --> B[Chat state]
  B --> C[Render lifecycle]
  C --> D[Chat renderer]
  D --> E[DOM commit]
  C --> F[Optional performance probe]
  E --> F
Loading

Technical review

Best possible solution:

Keep performance observation at the existing lifecycle boundary while preserving independent checks of rendering and composer behavior.

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

The original probe directly traverses Lit prototypes and replaces requestUpdate, establishing the stated renderer coupling in source.

Is this the best way to solve the issue?

The existing lifecycle owner is a reasonable observation boundary, and both streaming updates and composer invalidations reach it without introducing another rendering owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cdeb1e37adc6.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Verified introduced change: The pinned introduction diff replaces prototype patching, adds lifecycle notifications, and retains the workload sizes and numeric budget thresholds. (ui/src/e2e/chat-stream-runtime-budgets.e2e.test.ts:197, c62b2e07d67c)
  • Invalidation and commit boundaries: Invalidations are reported after lifecycle admission and before the host update request; commits are reported from hostUpdated while the lifecycle scope remains active. (ui/src/pages/chat/chat-state-controller.ts:368, c62b2e07d67c)
  • Composer coverage traced: The composer receives state.requestUpdate, which attach routes through RenderLifecycle.invalidate; restoring its former per-character requestUpdate would therefore reach the new counter. (ui/src/pages/chat/chat-pane-render.ts:587, c62b2e07d67c)
  • Exact-head CI: GitHub verifies that the linked CI run completed successfully for the reviewed head, including the selected Control UI E2E job; the body reports six passing budget cases. (c62b2e07d67c)
  • History and inspection limits: Current-main history and blame identify the lifecycle and budget contributors. An older composer-fix blob was unavailable locally, so GitHub commit patches supplied that comparison; raw CI logs redirected to a blocked artifact host, so their contents were not verified. (363a46d6e00b)

PR surface

Source +18, Tests -11. Total +7 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 19 1 +18
Tests 1 51 62 -11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 70 63 +7

Labels

Label changes:

No label changes.

Label justifications:

  • P3: Internal performance-test instrumentation with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Show the updated budgets failing when stream-frame deduplication is disabled and ordinary composer edits invalidate on every character.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-10T08:38:32.394Z sha c62b2e0 :: needs maintainer review before merge. :: none

Reviewed October 10, 2026, 4:51 AM ET / 08:51 UTC (Revision 2).

@steipete
steipete merged commit a5a2092 into main Oct 10, 2026
94 checks passed
@steipete
steipete deleted the solid2/p1-07 branch October 10, 2026 09:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
* test(ui): decouple chat runtime budgets from Lit

Report accepted invalidations and DOM commits through the renderer-neutral lifecycle test hook. Keep every numeric budget unchanged and retain counters in the E2E probe.

Release-note context: internal test instrumentation.

* Merge remote-tracking branch 'origin/main' into solid2/p1-07

* test(ui): satisfy lifecycle probe type and lint checks

Keep the observer signature tied to the production notifier without exporting a test-only type, document the optional-global assertion, and use the browser hook naming convention.

Co-authored-by: Peter Steinberger <[email protected]>
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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