Repository navigation
perf: keep the New Session composer out of Chat boot - #181144
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 changesExtract the accepted-composer registry so opening Chat no longer loads the New Session composer implementation. Example: Open Chat using the matched production builds reported in this PR.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is a focused, maintainer-directed performance improvement with no introduced correctness finding and successful exact-head CI. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherNew Session retains queued text and attachments until Chat adopts them; the registry connects those existing owners without sending messages itself. flowchart LR
N[New Session] --> C[Creation composer]
C --> R[Accepted composer registry]
H[Chat pane] --> R
R --> T[Composer transfer]
T --> O[Existing Chat outbox]
Technical reviewBest possible solution: Retain the focused registry extraction and existing custody owners. Do we have a high-confidence way to reproduce the issue? Current-main imports establish the eager dependency, and the reported matched builds quantify its transfer cost; no target code was executed during this read-only review. Is this the best way to solve the issue? The smallest complete fix is to separate the existing registry from the composer implementation and migrate every runtime consumer, which this diff does without adding a competing owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 784d9ce1b556. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +8, Tests -3, Other 0. Total +5 across 9 files. Added test files: 0. View PR surface stats
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 22, 2026, 9:42 PM ET / October 23, 2026, 01:42 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* perf: keep the New Session composer out of Chat boot * perf(ui): ratchet creation transfer boot budgets
Problem and change
Chat imports the accepted-composer registry from the New Session composer module, so opening an existing conversation also downloads the composer class and attachment draft. Move the existing registry unchanged into
creation-composer-registry.ts, with type-only imports of the composer. All three runtime consumers use that boundary; only New Session imports the class. Accepted initial turns, attachment custody, recovery, and account-change disposal retain their existing behavior.The registry remains the single owner of accepted composers. This changes module reachability, not state authority or rendering. Reuse the existing submission-handoff type to keep the submission owner within its file-size limit. No markup, dependencies, or lazy route boundaries change.
Matched boot measurement
Exact baseline:
35637f41d8207bd58409304d8ba778b4a7d3e2bd. Candidate runtime:de72a012558fa550f72ef8bd59b3dfa924db3ab3; final commit35965659ffc21bca4b8221a95a39e2bd08927045only updates budget constants/comments and the baseline reason. Both production builds used the same machine, Node 26.12.1, fixed build metadata, dependency tree, and 29 canonical plugin inputs. The strict performance comparison reports zero warnings and zero violations. Standalone module attribution confirmscreation-composer.tsandattachment-draft.tsleave Chat boot; module gzip estimates are diagnostic, not additive. The campaign's full graph attribution is in #181052.CSS is unchanged: startup 41,128 B / 1 request, Chat 145,939 B / 8 requests, New Session 106,449 B / 6 requests. No boot surface grows.
Caps preserve incoming relative headroom:
ceil(1347441 × 1400431 / 1349072) = 1398738for Chat andceil(822816 × 834356 / 823291) = 833875for New Session. The stricter 315,881 B startup baseline is unchanged; its reason is refreshed through--update-baseline --startup-js-bytes 315881 --reason.Validation
creation-composer.test.ts --maxWorkers=1extensions/telegram/src/telegram-ingress-worker.context.test-support.mjs; identical diagnostic from the same production command on exact base35637f41d8207bd58409304d8ba778b4a7d3e2bdci:full: 46 jobs passed, 24 skipped; sole real-Gateway failure plus aggregate gate. The exact session-PR reader case also fails on scheduled main 39890895258, at the same line 465 title assertion (replacement workspace expected, null received); inherited-failure route.Timing acceptance, fixed before the run: ten interleaved baseline/head cold-cache pairs, 240 synthetic messages, using the committed cold-load benchmark without tracing. Transcript-visible and enabled-composer median regression must each be ≤5%, and neither p95 may worsen. One further ten-pair batch is allowed if needed; all twenty pairs then count. Both exact revisions must use the same host and fixed inputs, with CPU/RAM/Node and host load recorded.
No visual screenshot pair is needed for this source import split: no JSX, markup, classes, CSS, or visible state changes. Production TypeScript LOC: 2,053 → 2,060 (+7); direct tests: 269 → 266 (−3); generated boot manifest: 1,851 → 1,852 (+1). The added lines form the import boundary; the registry implementation itself is unchanged.
Refactor-checklist census across the five touched production modules is unchanged:
createEffect,createRenderEffect,untrack, direct listeners, DOM queries, and Solid owner/flush APIs are all 0 → 0. Existinglistencalls are 8 → 8 andonCleanupis 1 → 1. The textualflush()occurrence belongs to the existing panel-action owner, not Solid's flush API. This performance-only extraction adds no reactive or lifecycle mechanism.Cold-load timing result
Blacksmith Testbox run, lease
tbx_01m5kbnhcyj0cwam3wc1s03eba: requested the existing check profile; observed AMD EPYC with 4 available CPUs and 16,555,134,976 B RAM, Node 24.22.1. Both exact revisions were built with identical 29 plugin inputs and fixed metadata. The committed benchmark used production Vite preview, synthetic bootstrap/RPC/media, 240 messages, retained UI state, cold HTTP cache, and no tracing. Command:scripts/bench-control-ui-cold-load.ts --runs 20 --face chat --untraced --cold-http-cache --transcript-messages 240 --fixture-now-ms 1792712700000, alternating the baseline and candidate bundle directories.The first setup command completed both builds, then stopped because the proof wrapper expected the build-proof file under a renamed filename. No timing samples were collected in that setup attempt. The corrected command compared the existing build proofs, re-verified all 17 material source hashes, and measured those same builds on the same lease. Only one ten-pair timing batch was needed. All 73 exported artifacts are downloaded and hash-verified, including raw samples, host-load values, identical build proofs for 29 plugin inputs, and the frozen 17-file source manifest. The Testbox is stopped and settled; its native SSH key is removed. This synthetic boot comparison does not measure live model latency.