Repository navigation
perf(ui): remove redundant first-screen boot work - #182945
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR defers unnecessary chat boot work, preserves displayed pins during query replacement, and combines transcript measurement with initial-row admission. Example: Open the synthetic desktop chat with 390 sessions, 30 pins, and 240 messages.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides a measured boot improvement, preserves existing owners, and has no actionable correctness or security findings; the exact-head CI gate is green. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI projects synchronous pane state, session descriptors, authenticated avatar resources, and transcript geometry into the visible chat interface. flowchart TD
A[Gateway session data] --> B[Existing sidebar descriptor owner]
B --> C[Visible pins]
D[Synchronous pane state] --> E[Lazy field publications]
E --> F[Chat interface]
G[Credential scoped avatar loader] --> F
H[Transcript measurement and admission] --> F
Technical reviewBest possible solution: Retain the focused optimization within the existing publication, descriptor, avatar, and transcript owners. Do we have a high-confidence way to reproduce the issue? Current-main source establishes eager publication and avatar work, while the supplied production-bundle benchmark demonstrates the renderer workload and its measured improvement. Is this the best way to solve the issue? The patch uses existing owners, preserves synchronous reads and descriptor authority, and removes redundant work without introducing another scheduler or cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0e6e2311fbd6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +19, Tests +101. Total +120 across 11 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 24, 2026, 6:27 PM ET / 22:27 UTC. |
|
Merged via squash.
|
* perf(ui): remove redundant first-screen boot work * test(ui): await deferred avatar request admission
What Problem This Solves
Chat boot still creates avoidable first-screen work and repeatedly collapses displayed pins while their query is replaced.
Related: #182814, #182825. Measured on current main
3df26eebaf4, including #182813.User Impact
The synthetic desktop chat workload now reaches 136.5 ms median boot long tasks, below the 150 ms target. The final viewport, selectors, retained content, and saved-reader behavior are preserved. Displayed pins remain stable while their authoritative descriptor loads.
Why This Change Was Made
Create pane field signals only when a tracked reader first needs them, preserving synchronous plain-owner reads. Admit cold authenticated avatars in the next task and recheck the existing credential-scoped cache entry before fetching. Remember live displayed pins through the existing connection-scoped descriptor seed; a missing descriptor still removes the row. During hidden transcript fill, measure rows and decide whether to admit the next row in one pass instead of short-circuiting into another render/geometry pass.
No transcript scheduler, new cache, dependency, owner, or public API was added. The pin seed parameter now names only the descriptor fields it already copies.
Evidence
Acceptance recorded before measurement: twenty serial interleaved base/control/head triples; identical production bundles for the A/A control; fresh application storage, warm immutable server assets; 390 sessions, 30 pins, 240 messages, avatars enabled, 1719×1179. Production Gateway HTTP/assets with synthetic WebSocket RPCs and media. Untraced timing with renderer thread CPU; no concurrent local checks or builds. Host load was 60.9–79.1, so the A/A readiness spread is material. The retained head is within the 5% timing/CPU band against the faster control; no cell approaches a 20% regression.
Remaining long-task owners and measured attempts
The following single CPU-profile captures identify owners; profiler overhead inflates their times, so they are not the acceptance timings above. Whole-task times are disjoint; source owners within each task overlap.
Diagnostic layouts: 251 → 243; forced layouts: 125 → 119. No sanitizer or Markdown safety boundary changed.
Rejected prototypes were removed: progressive overscan had 193 → 196.5 ms long tasks; one-row scheduling reached 114.5 ms but delayed transcript readiness by 20.1%; two-row scheduling reached 71.5 ms but delayed it by 11.9%. These were separate paired experiments on the earlier base and are not compared numerically with the current-main run.
Checks, assets, and visual proof
pnpm tsgo:ui, focused avatar/field/pin/rail/transcript-geometry tests, scoped oxlint, oxfmt, and the Control UI controller guard. Focused proof was reused across the disjoint main update; final type checking and broad PR CI cover the integrated head.extensions/codex/src/app-server/protocol-validator-schemas.ts,src/gateway/mcp-app-standalone-host.ts,src/gateway/worker-environments/repository-node-requirement.ts, andsrc/sessions/runtime-context.ts. The exact same four findings reproduce with the same production Knip command on pinned base3df26eebaf4; no UI finding or new ignore was added.The first full CI run (
40136147144) caught 11 avatar assertions that assumed same-turn request admission across four existing consumer files. Those tests now wait for the observable request; fake clocks admit it before measuring the unchanged 30-second deadline. Authentication, cancellation, pending-preview, sharing, and cache-pressure assertions remain. All four files pass locally under pinned Bun (69 tests); the chat file was first run through the UI package’s Node entrypoint, then corrected to the root default runner for this proof; production code and measured bundles are unchanged by this test repair. These failures were treated as PR-caused, not inherited.No remote compute lease or Docker was used.
ci:fullis selected for the shared boot path.