Skip to content

perf(ui): keep cloud worker settings copy out of startup - #138461

Closed
obviyus wants to merge 2 commits into
mainfrom
codex/control-ui-startup-size
Closed

obviyus wants to merge 2 commits into
mainfrom
codex/control-ui-startup-size

Conversation

@obviyus

@obviyus obviyus commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #121497. Shared startup-size follow-up for #131161, #132729, and #138459.

Additional instructions

This same-repository branch is available for maintainer edits.

What Problem This Solves

Control UI startup downloads Cloud Workers settings copy even when the operator opens only New Session or Chat. This moves that page-only copy out of startup and retains the existing settings behavior.

Why This Change Was Made

Move the unchanged namespace into the existing lazy Settings English catalog and register it synchronously when the Cloud Workers page loads. Settings search already loads this catalog. Keep the empty startup anchor so complete catalog composition retains its key order.

The refresh against main preserves its separate Model Providers extraction, both namespace registrations, and every current English string. It also fixes the original page-formatting failure. No new loader, dependency, configuration, storage, CSS, baseline, or budget change is needed. Shared navigation labels remain eager.

User Impact

New Session and Chat download less startup JavaScript. Cloud Workers settings keep the same labels, validation messages, translation fallback, and behavior. Cloud provisioning, permissions, credentials, and profile persistence are unchanged.

Evidence

Refreshed candidate: 1a65eb0224cccc1e4d2d4c1a4aec835c67bdab63, based on main 3a180c4eba703c3bcb0416d60d940a315d685e8f. Same-host macOS production UI builds used Node 24.20.0, Vite 8.2.2, Rolldown 1.2.5, and pako 3.0.1. The candidate proof bundle embeds the candidate SHA as its build ID.

Measurement Main base Refreshed candidate
Startup JS gzip 347,136 B 346,166 B
Startup JS requests 8 8
Startup CSS gzip 43,919 B 43,919 B

The native budget evaluator reports no violations, and the candidate independently passes the original 350,141 B ceiling with 3,975 B to spare. No budget or baseline file is changed by this PR.

  • The cold-catalog regression fails on the refreshed base because page-only copy is eager, then passes on the candidate.
  • 103 focused tests pass across Cloud Workers config/page mutations, cold English loading, localized fallback, locale lifecycle, and Settings search.
  • The complete English catalog is byte-identical, including key order: 6,314 keys and 284,994 serialized bytes. Shared navigation labels are unchanged.
  • Parsed production source maps and static imports place the copy in the lazy Settings chunk, outside the static startup graph.
  • Real Chromium exercised New Session, Cloud Workers settings, and invalid-form feedback on both production bundles. Full page text is identical. Both runs have zero page errors and zero config writes; no cloud worker was provisioned.
  • Full pnpm build, the complete changed-check gate (including core-test/UI type checks and lint), keyless i18n verification, and scoped formatting pass.
  • Fresh independent Codex review of the complete refreshed diff is scoped-clean through P2.

Production: +68/-63 (net +5); tests: +30/-0. The five structural lines preserve source order and register the existing catalog at the lazy consumer. Both original commits retain Ayaan Zaidi's authorship; Peter Steinberger is the rebase committer.

Exact-head CI and the native prepare/merge checkpoint remain required before landing.

@clawsweeper

clawsweeper Bot commented Sep 4, 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 commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

#138465 is waiting for this shared startup-budget repair. Its completed CI has only the performance check (and aggregate gate) failing: 350,479 B against the unchanged 350,141 B limit; the pre-fix baseline proof was already 350,386 B.

This PR's performance check passes. Its remaining lint failure is oxfmt --check on ui/src/pages/cloud-workers/cloud-workers-page.ts. I am leaving this branch with its current owner and will refresh #138465 after this lands.

Update: main now contains the Model Providers copy deferral in f804e08 (#137342). Rebasing #138465 onto main 0062f2b127b gives 349,103 B against the same 350,141 B limit, so it no longer needs to wait for this PR. No changes to this branch were made.

@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Maintainer landing follow-up for the shared startup-size prerequisite: I’m taking over the bounded merge-conflict and formatting repair so this PR can unblock the combined screenshot-recording and Logs fix.

The startup budget will remain unchanged, and the original contribution and credit will be preserved. I’ll verify the refreshed source, focused behavior, exact-head CI, and native landing gates before merging. The existing assignment remains intact; please flag any in-flight branch changes so we avoid overlapping pushes.

@steipete
steipete force-pushed the codex/control-ui-startup-size branch from 7be804b to 1a65eb0 Compare September 4, 2026 19:07

@steipete steipete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Holding landing on source-history preservation, not on the catalog optimization itself.

The current head 1a65eb0224cccc1e4d2d4c1a4aec835c67bdab63 no longer descends from either original contribution commit, db705e31c6faad28bbd9ca2e6151a530db21eba3 or 7be804be6aa89b3473e3549451f52b48c88073ec (both git merge-base --is-ancestor checks exit 1).

The maintainer landing workflow does not permit squashing a contributor-owned PR after maintainer ancestry replacement. Preserve the original source chain and append the reviewed main/conflict/format repair, or use the workflow's explicitly credited replacement path. Keep the current repaired work available while restoring a valid source history; do not discard either contribution.

Please refresh exact-head review/CI/native preparation after that correction. The shared capture PR remains separate, and no budget or assertion weakening is needed.

@steipete
steipete dismissed their stale review September 4, 2026 19:12

Correcting my ownership classification: the author's live repository role is maintain. I applied the contributor-owned replacement rule too broadly to this maintainer-owned, same-repository branch. Withdrawing this ancestry-only hold; preserve original author attribution and require fresh exact-head review, CI, and native landing gates. No branch rewrite is requested solely to restore commit IDs.

@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The bounded conflict and formatting repair is complete on 1a65eb0224cccc1e4d2d4c1a4aec835c67bdab63, based on main 3a180c4eba703c3bcb0416d60d940a315d685e8f. Both original commits retain Ayaan Zaidi's authorship. The existing assignment is unchanged.

The refreshed build reduces startup gzip from 347,136 B to 346,166 B, below the original 350,141 B ceiling. No baseline or budget files changed. All 6,314 English keys preserve their bytes and order; source maps place the moved copy outside the static startup graph. The 103 focused tests, full pnpm build, complete changed-check gate, keyless i18n verification, scoped formatting, and independent P0–P2 review pass.

The screenshots compare actual production bundles with a synthetic Gateway. New Session and Cloud Workers settings load, all page text remains identical, and invalid-profile feedback renders with zero page errors or config writes. No worker was provisioned.

Exact-head CI run 33909537512 and the final native checkpoint are still required before merge.

Before: Cloud Workers settings on refreshed main

After: identical Cloud Workers settings on the repaired head

@vincentkoc

Copy link
Copy Markdown
Member

Closing as superseded by #138490, landed as 7ab8ca3a6b6ea8e9bb8ce9c6f96590795d19a0e4.

This PR by Ayaan Zaidi (@obviyus) first proposed the Cloud Workers lazy-catalog repair. Its uneditable branch and formatter failure led to the credited replacement #138472. Equivalent production behavior is now on main. Thank you for identifying and implementing the fix.

@vincentkoc vincentkoc closed this Sep 4, 2026
@RomneyDa
RomneyDa deleted the codex/control-ui-startup-size branch October 22, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants