Skip to content

perf(ui): load Cron without the transcript runtime - #194165

Merged
steipete merged 7 commits into
mainfrom
solid2/w-perf-firefox-1106
Nov 6, 2026
Merged

steipete merged 7 commits into
mainfrom
solid2/w-perf-firefox-1106

Conversation

@steipete

@steipete steipete commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cron first visits loaded Chat's transcript runtime before any run transcript was opened.

User Impact

Cron becomes ready faster in all three engines, with the same controls, layout, pagination, and focus behavior. First visit removes three JavaScript requests, one stylesheet request, and 1,461,705 decoded JavaScript bytes.

Why This Change Was Made

Keep transcript preparation and the earlier-history renderer behind one Cron-owned lazy runtime. The existing run owner retains request and error state, and rechecks its scope after the import. Move the sole-caller pagination helper into that runtime and remove its eager chunk assignment.

This revises the earlier Cron conclusion from W-PERF-READINESS-REGRESSIONS and W-PERF-LATE-STYLESHEETS: the remaining first-visit cost was reducible through this accidental eager Chat dependency.

Evidence

Acceptance: at least 5% target median improvement; 20 rotated base/head/identical-base triplets in each engine and viewport, with no p95 regression. Production bundles and the committed synthetic Gateway workload, headless browsers, localhost. Application readiness is page-local, including WebKit. All 360 observations passed. Host load (1 minute): 7.51–12.78, median 9.75. Baseline for these timings: 5c31034348323a894bf0f50822459ae77e2dc003.

Engine / viewport Base median / p95 ms Head median / p95 ms A/A median / p95 ms
Firefox desktop 185 / 196 122 / 130 182 / 193
Firefox mobile 158 / 173 97.5 / 112 159.5 / 175
Chromium desktop 109.6 / 111.8 92.85 / 94.7 109.15 / 111.1
Chromium mobile 96.55 / 100.7 81.65 / 84.6 95.6 / 98.7
WebKit desktop 192.5 / 228 146 / 160 196.5 / 220
WebKit mobile 183.5 / 191 140 / 147 181.5 / 200

Ready-window work: JavaScript requests 32 → 29; CSS requests 7 → 6; decoded JavaScript 2,056,639 → 594,934 B.

The campaign coordinator explicitly accepted the original 87 B normalized-gzip trade from the shorter Cron preload list and requested integration of #194135, then caps at the measured head plus 64 B. After that integration, the measured increase is only 4 B; no padding, arbitrary sorting, or third cap change was added. The two caps are now 1,287,916 B for Chat and 796,969 B for New Session, both lower than the landed paydown caps.

Final paired builds use main 73005a14b8c2c68565e7a8abfffa6834a160a5f2 and this branch on the same Mac/Node 26.12.1 toolchain, with 13 byte-identical plugin input files. The cap-only edit does not change those runtime bundles.

Surface Base Head Delta
Startup JS gzip 89,622 B 89,622 B 0 B
Startup CSS requests 1 1 0
Chat boot JS gzip 1,287,848 B 1,287,852 B +4 B
New Session boot JS gzip 796,901 B 796,905 B +4 B
Largest ordinary JS gzip 559,830 B 559,834 B +4 B
Total CSS raw 1,675,553 B 1,675,553 B 0 B

The strict paired check passes with zero violations. The base's standalone strict check reports total CSS raw above its 1,675,382 B cap; the head has exactly the same bytes. That cap stays unchanged. Startup and every other cap stay unchanged. Chat/New requests remain 20/15.

Checks completed: UI typecheck; UI-pages test type leaf; chunking tests 9/9; scoped lint/format and diff check; production Knip. Independent full-context Codex P0–P2 review and cap review found no actionable issue. Targeted browser proof covers opening, earlier-page loading, retaining the later message, close-to-trigger focus, and import failure regression coverage. The first selected CI run exposed an overstated test-line allocation and two test assumptions: concurrent loaders can show two statuses, and a shared chunk can retry within one document. The repair uses the existing first-document failure fixture and preserves the global recovery owner. The seven-case E2E file passed locally (20.03 s), and the persistent history-import failure case passed again with no extra production recovery code (13.11 s invocation; 1.58 s case). Independent review of the repair was clean. Full CI passed on the exact landed head cc01d351ed1a0850cf3fd1b7e1b29f821fcac2b7: run 42246536847, 43 jobs passed and 25 skipped, with no failures or cancellations. Landed as 21cd90050fb6b8389cc5c8b81a1ee40230aba901.

Production LOC across changed files: 1,803 → 1,819 (+16), including the unchanged-length budget checker; behavioral/chunking tests +6; test-line allocation +2. No new effects, signals, cleanup hooks, subscriptions, DOM queries, or synchronized state. One new lazy boundary and one guarded import.

Both synthetic before/after screenshot pairs were inspected and are byte-identical.

Cron before Cron after
Cron before Cron after
Open transcript before Open transcript after
Transcript before Transcript after

Keep Chat history processing and the earlier-history renderer out of the first Cron visit. Load the shared transcript runtime on demand and recheck the active scope before applying its result. Move the Cron-only pagination helper into that runtime.
@clawsweeper

clawsweeper Bot commented Nov 6, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T15:50:59.445558Z cc01d35 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR defers Cron transcript preparation and history controls until a run transcript is opened.

Example: Open Automations before selecting View transcript.

  • Before: The reported production-browser workload downloads 2,056,639 decoded JavaScript bytes.
  • After: The same workload downloads 594,934 bytes, with transcript code deferred until requested.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, compact performance work with credible normal-path evidence, two definite CI defects, and unresolved fault-recovery validation.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Opening Automations downloads and evaluates transcript code before the operator requests a transcript.
Reason: The maintainer-authored direction removes measurable first-visit work while preserving the existing request, presentation, and pagination owners.

Merge readiness

⛔ Needs changes before merge - 3 items remain

Keep open: this maintainer-authored PR provides a useful, focused performance improvement, but two deterministic CI defects need repair before landing.

Priority: P2
Reviewed head: 2e8d7689e1015e19608378b857a7452d57c5b065

Before merge

  • Make the loading-status wait tolerate both pending regions (P2) - Holding history processing while the transcript feed also loads leaves two visible Loading status elements. The new strict getByRole('status').waitFor() therefore throws before either hold is released, as exact-head browser CI confirms at line 83. Use an assertion scoped to the intended loading region, or explicitly assert the expected multiple statuses, while retaining the delayed-import and focus checks.
  • Limit the test-line allocation to the net test growth (P2) - This allocation grants 10 lines, but the transcript test adds 10 net lines and the chunking test removes 4, for a total increase of 6. scripts/check-test-lines-ratchet.mts rejects allocation credit greater than net added test lines, so this value deterministically fails the test-lines gate. Set the allocation to the final justified net increase after repairing the tests.
  • Complete next step - After perf(ui): reclaim Chat boot bytes and lower budgets #194135 lands, integrate its budget changes and complete the measured-cap update already required by this PR's body.

Findings

  • [P2] Make the loading-status wait tolerate both pending regions — ui/src/pages/cron/run-transcript.e2e.test.ts:83
  • [P2] Limit the test-line allocation to the net test growth — config/test-lines-allocations/cron-transcript-lazy.txt:2

Tests

  • Missing end-to-end proof: The new history-processing import-recovery case has no passing result: exact-head CI times out awaiting guarded document navigation.
Agent review details

How this fits together

The Control UI loads Cron through its route bundle; selecting a recorded run requests cron.history, prepares its messages, and renders the shared Chat transcript components.

flowchart LR
  A[Automations route] --> B[Cron run owner]
  B --> C[Gateway cron history]
  C --> B
  B --> D[Lazy transcript runtime]
  D --> E[Prepared messages]
  E --> F[Transcript view]
Loading

Technical review

Best possible solution:

Keep the existing Cron owner and lazy runtime, repair the focused CI defects, and complete the already-declared budget integration before landing.

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

Current main's eager imports establish the unnecessary dependency path, and the supplied production-browser measurements quantify its cost; this read-only review ran no reproduction.

Is this the best way to solve the issue?

The invariant is that opening Automations must not require transcript processing; moving existing preparation and its sole-caller pagination helper behind one Cron-owned import is the smallest complete fix.

Full review comments:

  • [P2] Make the loading-status wait tolerate both pending regions — ui/src/pages/cron/run-transcript.e2e.test.ts:83
    Holding history processing while the transcript feed also loads leaves two visible Loading status elements. The new strict getByRole('status').waitFor() therefore throws before either hold is released, as exact-head browser CI confirms at line 83. Use an assertion scoped to the intended loading region, or explicitly assert the expected multiple statuses, while retaining the delayed-import and focus checks.
    Confidence: 1
  • [P2] Limit the test-line allocation to the net test growth — config/test-lines-allocations/cron-transcript-lazy.txt:2
    This allocation grants 10 lines, but the transcript test adds 10 net lines and the chunking test removes 4, for a total increase of 6. scripts/check-test-lines-ratchet.mts rejects allocation credit greater than net added test lines, so this value deterministically fails the test-lines gate. Set the allocation to the final justified net increase after repairing the tests.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Cron transcript preparation and pagination keeps the original intent (718bf2c: Move retained automation transcript access from Tasks to Cron while retaining shared rendering and recorded-run identity.)
  • Lazy transcript presentation keeps the original intent (5949887: Load recorded output on demand while retaining transcript controls, focus, and stale-asset recovery.)
  • Cron chunk assignment keeps the original intent (4b709b8: Group Cron modules already needed together on first visit while keeping optional detail work lazy.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-lines-ratchet --base ed3c5da --no-merge-base
  • pnpm test:ui:e2e ui/src/pages/cron/run-transcript.e2e.test.ts
  • git diff --check

What I checked:

  • Introduced change and current main: The pinned introduction diff moves preparation and pagination into one lazy runtime; fetched main still imports those responsibilities eagerly. (ui/src/pages/cron/run-transcript.tsx:96, 2e8d7689e101)
  • Browser CI failures: The exact-head browser check records a strict-locator failure at the new loading wait and a timeout in the new history-processing import-recovery case. (ui/src/pages/cron/run-transcript.e2e.test.ts:83, 2e8d7689e101)
  • Test-line allocation exceeds growth: The two changed test files grow by a net six lines, while the new allocation grants ten; the ratchet explicitly rejects credit above net growth, and CI identifies test-lines as failed. (config/test-lines-allocations/cron-transcript-lazy.txt:2, 2e8d7689e101)
  • Existing ownership preserved: The original Cron transcript work established recorded-run identity and shared transcript preparation; this patch preserves those operations, overlap semantics, and current-scope checks. (ui/src/pages/cron/run-transcript.tsx:97, 53068bcab3a6)
  • Explicit prerequisite and accepted tradeoff: The maintainer-authored body accepts the 87-byte normalized-gzip tradeoff and explicitly postpones landing until perf(ui): reclaim Chat boot bytes and lower budgets #194135 is integrated and budgets are updated; that prerequisite remains open.
  • Supplied browser evidence inspected: The body reports rotated production-browser measurements across three engines; both downloaded transcript images show matching presentation, while the prepared Cron-after image contains only a small avatar and cannot establish page parity. (2e8d7689e101)

PR surface

Source +16, Tests +6, Other +2. Total +24 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 31 15 +16
Tests 2 17 11 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 50 26 +24

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test growth Production +16 lines; tests +6 lines Production growth supplies the lazy boundary and post-import scope check while moving the existing pagination implementation without adding another state owner.

Labels

Label changes:

  • add P2: This is a measured improvement to Automations readiness with a limited UI blast radius and focused repairable blockers.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a measured improvement to Automations readiness with a limited UI blast radius and focused repairable blockers.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 execution lanes are retired.

Reviewed November 6, 2026, 9:31 AM ET / 14:31 UTC.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Nov 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Nov 6, 2026
@steipete
steipete enabled auto-merge (squash) November 6, 2026 15:55
@steipete
steipete merged commit 21cd900 into main Nov 6, 2026
103 of 104 checks passed
@steipete
steipete deleted the solid2/w-perf-firefox-1106 branch November 6, 2026 16:00
@steipete

steipete commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
* perf(ui): defer cron transcript runtime until requested

Keep Chat history processing and the earlier-history renderer out of the first Cron visit. Load the shared transcript runtime on demand and recheck the active scope before applying its result. Move the Cron-only pagination helper into that runtime.

* test(ui): make cron transcript recovery proof deterministic

* build(ui): ratchet Cron boot budgets after paydown
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S 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