You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while diagnosing #4624. Companion to #4661 (untrusted projects).
Problem
Even in a trusted project, opening a workspace competes with its own onChat replay:
Server: the renderer fires four workspace.executeBash calls for the opened workspace ~5 ms before the replay starts (GitStatusStore status script, git fetch, PRStatusStore gh pr view, gh stack view). Their four bash spawns often land in the same tick. Each fork blocks the Electron main thread for ~11-16 ms, so there is ~55 ms of continuous event-loop lag inside the replay's history read. Cold-open historyReadMs for a 31 KB epoch is ~118 ms. When the main process is idle, the same read takes ~17-48 ms.
Renderer: with the trusted fixture those calls finish sooner and their results render during the transcript paint. The cold-open gap from caught-up to first row grew from ~107 to ~139 ms, and dom.longestTaskMs from 87 to 146 ms (perf.chatSwitch, medians of 18 cold opens).
Trusted perf.chatSwitch medians after #4624's harness fix: cold-open-small server.totalMs 151.9, first row 388.3 ms (store switch).
Options
Start the workspace-open git/PR probes after the chat is caught up. Use the existing caught-up signal, not a timer, with a fallback when it never arrives.
Cut the eager calls on open: merge status and fetch into one script, and run gh stack view only when the PR is part of a stack.
Found while diagnosing #4624. Companion to #4661 (untrusted projects).
Problem
Even in a trusted project, opening a workspace competes with its own onChat replay:
workspace.executeBashcalls for the opened workspace ~5 ms before the replay starts (GitStatusStore status script, git fetch, PRStatusStoregh pr view,gh stack view). Their four bash spawns often land in the same tick. Each fork blocks the Electron main thread for ~11-16 ms, so there is ~55 ms of continuous event-loop lag inside the replay's history read. Cold-openhistoryReadMsfor a 31 KB epoch is ~118 ms. When the main process is idle, the same read takes ~17-48 ms.caught-upto first row grew from ~107 to ~139 ms, anddom.longestTaskMsfrom 87 to 146 ms (perf.chatSwitch, medians of 18 cold opens).Trusted perf.chatSwitch medians after #4624's harness fix: cold-open-small server.totalMs 151.9, first row 388.3 ms (store switch).
Options
caught-upsignal, not a timer, with a fallback when it never arrives.gh stack viewonly when the PR is part of a stack.Measure with
tests/e2e/scenarios/perf.chatSwitch.spec.ts(--workers 1, summarize withbun scripts/perf/chatSwitchTable.ts artifacts/perf/electron).Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high