Repository navigation
🤖 perf: load the agent interface status view only with the view - #7515
Conversation
Fails on main: ChatPane statically imports AgentInterfaceStatusView, which reaches ArtifactViewer and SandboxedArtifactFrame. The next commit fixes it.
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. |
🟢 e2e stories (Haiku): 14 passed27 agent steps · 12 replayed from cache · 15 model calls · 45.8k tokens (26% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 21s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 8.0k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 20.9s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Perf owner: merge record for #7515 (fixes #7510).
Generated with |
…equests) (coder#7521) ## Summary Reverts `coder#7515`. A same-session VM Lighthouse A/B shows it made the seeded workspace page slower on desktop: median LCP +72.5 ms (1615.0 -> 1687.5 ms, 6+6 ABBA, all runs quiet). The limit is +40 ms. ## Background `coder#7515` made the status view lazy so the workspace page would stop loading the artifact frame (`coder#7510`). The seeded page also loads the right sidebar, and the right sidebar still imports the artifact stack (`McpAppFrame.tsx:59` imports a constant from `SandboxedArtifactFrame`; RightSidebar shares `useArtifactInteractions` and the viewers). So the frame code still loads, only later: in the right-sidebar wave at about 335-380 ms instead of the early wave at about 150 ms, plus three new shared chunks (33 -> 36 requests, +5.8 KB script). LCP equals TTI in every run, so the later graph end moves LCP. Details and per-run numbers: coder#7510 (comment) ## Implementation `git revert 47d2e4d`. ChatPane imports `AgentInterfaceStatusView` statically again, and the `rendererFirstLoad.test.ts` guard added by `coder#7515` goes too (on main the guard is false again, so it would fail). `coder#7510` is reopened; the next attempt fixes the sidebar importers first and gates on the seeded page's real request list plus a VM A/B. ## Validation - `make static-check` passes locally. - Expected VM result after merge: seeded desktop back to the `cf7b78bd55` level (about 1604-1615 ms), 33 requests. ## Risks Low. This restores the code that was on main until 19:43Z today. The status view (experiment-gated) behaves the same either way. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$1855.40`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=1855.40 -->
Fixes #7510
Summary
With the Agent interface view off (the default), the workspace page no longer downloads the artifact frame code. ChatPane now loads
AgentInterfaceStatusViewthrough a module-levelReact.lazyinsideLazyFeature, and renders it only when the view is"status". The page's static chunk set drops by 22,389 B brotli. Nothing changes when the experiment is on.Background
#7455 added
<AgentInterfaceStatusView>to ChatPane with a static import. The view returnsnullunless the view is"status", but the import still pulledArtifactViewer,SandboxedArtifactFrameand the artifact renderers into the page's static closure. Since #7455, the VM Lighthouse seeded-desktop LCP median rose from 1560-1570 ms to 1600-1651 ms.Implementation
ChatPane.tsx: the import becomesReact.lazy(() => import(".../AgentInterfaceStatusView"))at module top level. A smallLazyStatusViewcomponent in ChatPane.tsx holds the open condition (view === "status") and theLazyFeature, so a closed view never fetches the chunk (AGENTS.md "Module Imports" exception). The condition sits in that component and not inChatPaneContent, because one more branch there failsQuality / CRAP(CC 233 -> 234). The view keeps its place before the scrollport, so Tab still reaches the page before the composer. It still getskey,view,dockRefandcomposerApiRef.AgentInterfaceStatusView.tsxis unchanged. Its ownview !== "status"check is now always false, and I kept it to avoid touching a file outside the clearance.WorkspaceMenuBar.tsxis unchanged. ItsAgentInterfaceViewToggledoes not reach the frame: the head build's page set has noSandboxedArtifactFramesource.Validation
Method: I built each tree the same way on one host (bun 1.4.3:
make src/version.ts,bun x vite build,bun scripts/precompress-static.ts dist). The page chunk set ismain-*.jsplus the chunk that holdsAIView.tsx(App.tsx starts it on boot), closed over staticimport … from "./x.js"edges between built chunks. Each chunk counts its.brsize, or its raw size when precompress-static skipped a tiny file.mermaid-LQXJBOYN-*.js(br)SandboxedArtifactFramein setGates (declared by the perf owner before measurement):
SandboxedArtifactFramesources. Base set: 18 chunks, includingSandboxedArtifactFrame-*.js. Head set: 17 chunks, without it. 35 sources left the set and none were added. A new 2,732 Bartifacts-*.jschunk now holdsartifactDocument.tsand its helpers. The page already loaded them inside the frame chunk, andagentInterfaceView.tsstill needs them.LazyStatusViewincluded).make check-react-compilerpasses.tests/ui/chat/agentInterfaceStatusView.test.tspasses.Guard: the first commit adds
the workspace page's static imports do not reach the artifact frametosrc/browser/rendererFirstLoad.test.ts. It fails on main (main has the bug) and passes with the fix. Mutation: when ChatPane importsAgentInterfaceStatusViewstatically again, the guard fails.Mermaid chunk attribution:
mermaid-LQXJBOYN-*.jsis a Rollup shared chunk that also holds ChatPane and WorkspaceMenuBar, and the page loads it statically. From 61e9f05 to the merge-base it gained 28 sources, mostly the artifact viewer stack thatAgentInterfaceStatusViewpulled in (ArtifactViewer, the Code/Csv/Diff/Image/Json/Markdown renderers,useArtifactInteractions,diffParser). This PR removes that stack, so the chunk drops by 10,658 B. It stays 2,443 B above pre-#7455. That remainder is code the page uses (AgentInterfaceViewToggle,agentInterfaceView.ts,useArtifactsRefreshTick) plus unrelated later growth inMessageRenderer.tsx,machineTurnPrompts.tsand ChatPane. It needs no change here.Dogfood: with the experiment off nothing is visible, and the bytes above are the proof. With the experiment on, I started
make dev-server-sandbox, created a local workspace, turned onartifactsandartifacts-agent-interface, and wrote astatus.htmlartifact. The status view appeared at 1800 px and 390 px. Switching to Chat unmounted it, and switching to Status mounted it again.Risks
Low. The first switch to the status view in a session now waits for one small chunk. The transcript is already invisible then, so the pane is blank for that load instead of showing the view's own "Loading…" line. A failed chunk load shows
LazyFeature's Reload message in place of the page.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$5.47