Skip to content

perf: keep the New Session composer out of Chat boot - #181144

Merged
steipete merged 4 commits into
mainfrom
solid2/w-perf-creation-transfer
Oct 23, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-perf-creation-transfer

Conversation

@steipete

@steipete steipete commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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 commit 35965659ffc21bca4b8221a95a39e2bd08927045 only 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 confirms creation-composer.ts and attachment-draft.ts leave Chat boot; module gzip estimates are diagnostic, not additive. The campaign's full graph attribution is in #181052.

Surface Base gzip B Candidate gzip B Change JS requests
Startup 316,324 316,294 −30 7 → 7
Chat 1,349,072 1,347,441 −1,631 23 → 23
New Session 823,291 822,816 −475 17 → 17

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) = 1398738 for Chat and ceil(822816 × 834356 / 823291) = 833875 for New Session. The stricter 315,881 B startup baseline is unchanged; its reason is refreshed through --update-baseline --startup-js-bytes 315881 --reason.

Validation

Proof Result
UI typecheck on integrated candidate Pass
creation-composer.test.ts --maxWorkers=1 7/7 pass; existing acceptance, custody, reconnect, and disposal assertions retained
Targeted lint and formatting / diff check Pass; final cap files formatted
Matched production builds and strict performance comparison Pass; values above
Production Knip on final candidate One inherited unused file, extensions/telegram/src/telegram-ingress-worker.context.test-support.mjs; identical diagnostic from the same production command on exact base 35637f41d8207bd58409304d8ba778b4a7d3e2bd
Simplification and isolated autoreview Registry logic moved unchanged; integration and final cap-inclusive reviews scoped-clean at P0–P2
Full PR CI Current-head 39893048501, with ci: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.
Cold-load timing Pass on exact final head: ten interleaved cold-cache pairs; median and p95 gates pass (details below)

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. Existing listen calls are 8 → 8 and onCleanup is 1 → 1. The textual flush() 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.

Metric Base median / p95 ms Head median / p95 ms Median / p95 change Gate
Transcript visible 406.85 / 626.50 404.40 / 447.20 -0.6022% / -28.6193% Pass
Composer enabled 406.10 / 625.20 403.65 / 446.40 -0.6033% / -28.5988% Pass

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.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 23, 2026
@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: M labels Oct 23, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-10-23T03:07:38.014685Z 3596565 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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Extract 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.

  • Before: Chat boot transfers 1,353,266 gzip bytes across 23 JavaScript requests.
  • After: Chat boot transfers 1,352,012 gzip bytes across the same 23 requests.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is narrow and source-correct with successful CI, while the expressly required runtime performance evidence remains incomplete.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Opening an existing Chat downloads New Session implementation code that the route does not need.
Reason: The maintainer-directed extraction removes measured waste with unchanged registry logic, lifecycle, and callers’ behavior.

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
Reviewed head: 95e24ea2900b2211fba56733596940445b19ecab

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The predeclared alternating cold-cache comparison has not yet demonstrated transcript and enabled-composer timing acceptance for this PR.
Agent review details

How this fits together

New 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]
Loading

Technical review

Best 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

  • Accepted composer registry keeps the original intent (ac93c14: Keep follow-up text and files available during creation, then transfer custody to the confirmed conversation while preserving recovery boundaries.)
  • Submitted draft handoff type keeps the original intent (c657a10: Retire only the captured submitted mutation after acceptance, preserving newer drafts across navigation; the reused type has the same ReturnType definition.)
  • Route byte budgets keeps the original intent (69740ce: Track the deferred-menu production graph with proportional route headroom; this PR ratchets those caps against its matched measurements.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e76ebe6 adds ui/src/pages/new-session/creation-composer.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e76ebe68919c; files: ui/src/pages/new-session/creation-composer.ts)
  • RoboClaw: Raw commit ac93c14 adds ui/src/pages/new-session/creation-composer.ts:2 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ac93c14ffd6f; files: ui/src/pages/new-session/creation-composer.ts)

PR surface

Source +8, Tests -3, Other 0. Total +5 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 105 97 +8
Tests 1 2 5 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 6 6 0
Total 9 113 108 +5

Labels

Label changes:

  • add P2: A small, measured Chat loading improvement with limited behavioral scope.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A small, measured Chat loading improvement with limited behavioral scope.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 October 22, 2026, 9:42 PM ET / October 23, 2026, 01:42 UTC.

@steipete
steipete merged commit 89a4230 into main Oct 23, 2026
133 of 142 checks passed
@steipete
steipete deleted the solid2/w-perf-creation-transfer branch October 23, 2026 03:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M 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