Repository navigation
perf(desktop): reuse the prepared shell environment in the local backend - #17384
Conversation
…cal backend The desktop merges the login shell environment into process.env before starting its local primary backend, then the server ran another synchronous interactive login shell through fixPath. The bootstrap now carries shellEnvironmentPrepared, which only the local primary sets, so the server skips PATH hydration there (HOME is still filled in). WSL, SSH, and standalone servers still hydrate their own environment. Standalone POSIX PATH capture now runs through ChildProcessSpawner with a 5s (login shell) and 2s (launchctl) timeout instead of execFileSync, so it no longer blocks the event loop. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
…vironment # Conflicts: # apps/server/src/os-jank.ts
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes desktop startup and the backend bootstrap contract: the local server skips its POSIX PATH probe based on propagated state, while desktop shell probing and fallback behavior are also modified. It also adds a line-level static-analysis suppression in a test, warranting direct human review of the cross-process behavior and diagnostic override. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Note Generated by GPT 6.1 Sol This verdict is an automatic-approval eligibility decision, with no reported correctness defect. Human review of the startup handoff remains appropriate. Desktop environment preparation runs before the local child starts, and that child inherits the environment through The diagnostic override is limited to the |
## What's Changed * feat(web): draft screen project picker is searchable by @juliusmarminge in pingdotgg/t3code#17664 * fix(server): report incomplete transcript usage scans by @maria-rcks in pingdotgg/t3code#15661 * fix(web): every resize-driven layout commits in the same frame by @maria-rcks in pingdotgg/t3code#17656 * fix(web): right panel and terminal drawer follow the pointer while dragging by @maria-rcks in pingdotgg/t3code#17657 * fix(web): terminal drawer keeps its height after the window shrinks by @maria-rcks in pingdotgg/t3code#17658 * perf(web): sidebar drags restyle only the sidebar by @maria-rcks in pingdotgg/t3code#17659 * fix(web): server browser page resizes while the panel is dragged by @maria-rcks in pingdotgg/t3code#17660 * fix(storage): make worktree cleanup work and show why it skipped by @maria-rcks in pingdotgg/t3code#17563 * test(usage): usage service tests keep their state directory until cache writes land by @tris203 in pingdotgg/t3code#17636 * fix(checkpoint): pulls and rebases no longer flood a turn's changed files by @t3dotgg in pingdotgg/t3code#17161 * fix(web): place notification icons after titles by @voltcrash in pingdotgg/t3code#12209 * fix(web): attachments on an open question are visible again by @tiliakoos in pingdotgg/t3code#15537 * fix(web): scale Files tree with interface font size by @Umais-Adeed in pingdotgg/t3code#8011 * fix(server): probe only owned preview listeners by @maria-rcks in pingdotgg/t3code#16687 * fix(chat): surface pending subagent questions on parents by @maria-rcks in pingdotgg/t3code#16634 * fix(web): section header chevrons point up when collapsed by @ZenderGoD in pingdotgg/t3code#14273 * fix(web): timeline divider pill shows a pointer, visible hover and focus ring by @jonesfionn101-dotcom in pingdotgg/t3code#15188 * fix(git): allow creating prs from dirty worktrees by @maria-rcks in pingdotgg/t3code#15625 * docs(install): polish binary install destination phrasing by @ege-arhan in pingdotgg/t3code#15732 * perf(server): keep passive terminal output flowing by @StiensWout in pingdotgg/t3code#17178 * fix(web): stop button icon no longer shifts on hover by @NK-Works in pingdotgg/t3code#16012 * fix(web): add bottom padding to expanded tool panels by @12ya in pingdotgg/t3code#16525 * fix(web): keep incremental highlighter return type portable by @luke2x in pingdotgg/t3code#17259 * fix(web): sidebar "Code" label no longer clips its letter tops by @akbarakma in pingdotgg/t3code#16134 * fix(tests): use POSIX paths for the simulated macOS device host by @Quicksaver in pingdotgg/t3code#17241 * fix(mobile): Android composer keeps the caret in view on AOSP-based keyboards by @bitmvk in pingdotgg/t3code#17492 * test(web): allow cold timeline imports on CI by @lastobelus in pingdotgg/t3code#16608 * fix(mobile): pinch zooms chat images on Android by @AKolenda in pingdotgg/t3code#15047 * fix(web): selected provider ring no longer clipped during panel resize by @jfortez in pingdotgg/t3code#17534 * docs(usage): OpenCode Go limits need a Go API key by @nexxeln in pingdotgg/t3code#15664 * fix(web): improve usage scanning indicator alignment by @AksharP5 in pingdotgg/t3code#15498 * fix(server): print pairing credential expiry as ISO timestamp by @kvnloo in pingdotgg/t3code#14128 * chore(ci): use GPT 6.1 Sol Max for check agents by @ishaanko in pingdotgg/t3code#14312 * fix(mobile): honor requested terminal native architectures by @bompus in pingdotgg/t3code#10709 * fix(server): keep preview browser connected after operation timeouts by @juliusmarminge in pingdotgg/t3code#17693 * fix(web): timeline divider focus ring stays inside the pill by @t3dotgg in pingdotgg/t3code#17702 * perf(desktop): reuse the prepared shell environment in the local backend by @Yash-Singh1 in pingdotgg/t3code#17384 * fix(web): align settings page widths by @diegoarff in pingdotgg/t3code#12158 * test(server): resolve the temp dir before matching the symlinked entrypoint by @ylcn91 in pingdotgg/t3code#9400 * fix(web): keep inline code pills intact when they wrap by @satyalyadav in pingdotgg/t3code#12038 * Revert "chore(ci): use GPT 6.1 Sol Max for check agents" by @maria-rcks in pingdotgg/t3code#17698 * fix(web): show the correct new thread shortcut in command palette by @vaishnavsm in pingdotgg/t3code#8513 * fix(desktop): declare macOS local network usage by @jsilets in pingdotgg/t3code#11922 * docs: add Scoop as Windows installation method by @Mostafa-Ben-Git in pingdotgg/t3code#10509 * fix(server): agents run in their own systemd scopes so an OOM kill spares the server by @t3dotgg in pingdotgg/t3code#17662 * fix(web): welcome wizard says where imported projects come from by @UzEE in pingdotgg/t3code#14584 * fix(web): cite works on responses that end before a tool call by @maria-rcks in pingdotgg/t3code#17713 * fix(desktop): sign Windows native addons by @Lumbreras2306 in pingdotgg/t3code#8206 * fix(server): track resumed subagent follow-ups as separate tasks by @Yash-Singh1 in pingdotgg/t3code#17696 * fix(web): nested corners follow their container's radius by @maria-rcks in pingdotgg/t3code#17695 * feat(web): pr panel actions confirm in place by @maria-rcks in pingdotgg/t3code#17710 * feat(web): reorder right panel tabs by dragging by @eimexdev in pingdotgg/t3code#17730 * fix(azure-devops): list pull requests with token sign-in and check out into worktrees by @maria-rcks in pingdotgg/t3code#17725 * fix(usage): keep one email in two workspaces as two accounts by @maria-rcks in pingdotgg/t3code#17711 * feat(pull-requests): hosts can report edit and resolve permissions per item by @juliusmarminge in pingdotgg/t3code#17667 * perf(server): run Git for Windows' real git.exe, not its launcher by @SunkenInTime in pingdotgg/t3code#17707 * fix(clients): restart continuations show as a T3 Code notice, not another agent's message by @juliusmarminge in pingdotgg/t3code#17723 * fix(mobile): browser picture in picture opens from the header button by @juliusmarminge in pingdotgg/t3code#17731 * feat(source-control): GitCafe lives in @t3tools/source-control-gitcafe by @juliusmarminge in pingdotgg/t3code#17681 * fix(web): add provider wizard no longer shifts sideways while it grows by @flamboh in pingdotgg/t3code#17292 * fix(web): PR search keeps the caret where you type by @flamboh in pingdotgg/t3code#17675 * fix(server): thread PR badges catch up when another environment reads the PR by @flamboh in pingdotgg/t3code#17729 * fix(server): refuse editor paths with line breaks or quotes when the editor is a Windows command shim by @juliusmarminge in pingdotgg/t3code#17749 ## New Contributors * @tiliakoos made their first contribution in pingdotgg/t3code#15537 * @Umais-Adeed made their first contribution in pingdotgg/t3code#8011 * @ZenderGoD made their first contribution in pingdotgg/t3code#14273 * @jonesfionn101-dotcom made their first contribution in pingdotgg/t3code#15188 * @ege-arhan made their first contribution in pingdotgg/t3code#15732 * @NK-Works made their first contribution in pingdotgg/t3code#16012 * @12ya made their first contribution in pingdotgg/t3code#16525 * @luke2x made their first contribution in pingdotgg/t3code#17259 * @akbarakma made their first contribution in pingdotgg/t3code#16134 * @Quicksaver made their first contribution in pingdotgg/t3code#17241 * @bitmvk made their first contribution in pingdotgg/t3code#17492 * @lastobelus made their first contribution in pingdotgg/t3code#16608 * @jfortez made their first contribution in pingdotgg/t3code#17534 * @diegoarff made their first contribution in pingdotgg/t3code#12158 * @ylcn91 made their first contribution in pingdotgg/t3code#9400 * @satyalyadav made their first contribution in pingdotgg/t3code#12038 * @vaishnavsm made their first contribution in pingdotgg/t3code#8513 * @jsilets made their first contribution in pingdotgg/t3code#11922 * @Mostafa-Ben-Git made their first contribution in pingdotgg/t3code#10509 * @UzEE made their first contribution in pingdotgg/t3code#14584 * @Lumbreras2306 made their first contribution in pingdotgg/t3code#8206 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261010.2908...v0.0.46-nightly.20261010.2922 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261010.2922
## What's Changed * feat(web): draft screen project picker is searchable by @juliusmarminge in pingdotgg/t3code#17664 * fix(server): report incomplete transcript usage scans by @maria-rcks in pingdotgg/t3code#15661 * fix(web): every resize-driven layout commits in the same frame by @maria-rcks in pingdotgg/t3code#17656 * fix(web): right panel and terminal drawer follow the pointer while dragging by @maria-rcks in pingdotgg/t3code#17657 * fix(web): terminal drawer keeps its height after the window shrinks by @maria-rcks in pingdotgg/t3code#17658 * perf(web): sidebar drags restyle only the sidebar by @maria-rcks in pingdotgg/t3code#17659 * fix(web): server browser page resizes while the panel is dragged by @maria-rcks in pingdotgg/t3code#17660 * fix(storage): make worktree cleanup work and show why it skipped by @maria-rcks in pingdotgg/t3code#17563 * test(usage): usage service tests keep their state directory until cache writes land by @tris203 in pingdotgg/t3code#17636 * fix(checkpoint): pulls and rebases no longer flood a turn's changed files by @t3dotgg in pingdotgg/t3code#17161 * fix(web): place notification icons after titles by @voltcrash in pingdotgg/t3code#12209 * fix(web): attachments on an open question are visible again by @tiliakoos in pingdotgg/t3code#15537 * fix(web): scale Files tree with interface font size by @Umais-Adeed in pingdotgg/t3code#8011 * fix(server): probe only owned preview listeners by @maria-rcks in pingdotgg/t3code#16687 * fix(chat): surface pending subagent questions on parents by @maria-rcks in pingdotgg/t3code#16634 * fix(web): section header chevrons point up when collapsed by @ZenderGoD in pingdotgg/t3code#14273 * fix(web): timeline divider pill shows a pointer, visible hover and focus ring by @jonesfionn101-dotcom in pingdotgg/t3code#15188 * fix(git): allow creating prs from dirty worktrees by @maria-rcks in pingdotgg/t3code#15625 * docs(install): polish binary install destination phrasing by @ege-arhan in pingdotgg/t3code#15732 * perf(server): keep passive terminal output flowing by @StiensWout in pingdotgg/t3code#17178 * fix(web): stop button icon no longer shifts on hover by @NK-Works in pingdotgg/t3code#16012 * fix(web): add bottom padding to expanded tool panels by @12ya in pingdotgg/t3code#16525 * fix(web): keep incremental highlighter return type portable by @luke2x in pingdotgg/t3code#17259 * fix(web): sidebar "Code" label no longer clips its letter tops by @akbarakma in pingdotgg/t3code#16134 * fix(tests): use POSIX paths for the simulated macOS device host by @Quicksaver in pingdotgg/t3code#17241 * fix(mobile): Android composer keeps the caret in view on AOSP-based keyboards by @bitmvk in pingdotgg/t3code#17492 * test(web): allow cold timeline imports on CI by @lastobelus in pingdotgg/t3code#16608 * fix(mobile): pinch zooms chat images on Android by @AKolenda in pingdotgg/t3code#15047 * fix(web): selected provider ring no longer clipped during panel resize by @jfortez in pingdotgg/t3code#17534 * docs(usage): OpenCode Go limits need a Go API key by @nexxeln in pingdotgg/t3code#15664 * fix(web): improve usage scanning indicator alignment by @AksharP5 in pingdotgg/t3code#15498 * fix(server): print pairing credential expiry as ISO timestamp by @kvnloo in pingdotgg/t3code#14128 * chore(ci): use GPT 6.1 Sol Max for check agents by @ishaanko in pingdotgg/t3code#14312 * fix(mobile): honor requested terminal native architectures by @bompus in pingdotgg/t3code#10709 * fix(server): keep preview browser connected after operation timeouts by @juliusmarminge in pingdotgg/t3code#17693 * fix(web): timeline divider focus ring stays inside the pill by @t3dotgg in pingdotgg/t3code#17702 * perf(desktop): reuse the prepared shell environment in the local backend by @Yash-Singh1 in pingdotgg/t3code#17384 * fix(web): align settings page widths by @diegoarff in pingdotgg/t3code#12158 * test(server): resolve the temp dir before matching the symlinked entrypoint by @ylcn91 in pingdotgg/t3code#9400 * fix(web): keep inline code pills intact when they wrap by @satyalyadav in pingdotgg/t3code#12038 * Revert "chore(ci): use GPT 6.1 Sol Max for check agents" by @maria-rcks in pingdotgg/t3code#17698 * fix(web): show the correct new thread shortcut in command palette by @vaishnavsm in pingdotgg/t3code#8513 * fix(desktop): declare macOS local network usage by @jsilets in pingdotgg/t3code#11922 * docs: add Scoop as Windows installation method by @Mostafa-Ben-Git in pingdotgg/t3code#10509 * fix(server): agents run in their own systemd scopes so an OOM kill spares the server by @t3dotgg in pingdotgg/t3code#17662 * fix(web): welcome wizard says where imported projects come from by @UzEE in pingdotgg/t3code#14584 * fix(web): cite works on responses that end before a tool call by @maria-rcks in pingdotgg/t3code#17713 * fix(desktop): sign Windows native addons by @Lumbreras2306 in pingdotgg/t3code#8206 * fix(server): track resumed subagent follow-ups as separate tasks by @Yash-Singh1 in pingdotgg/t3code#17696 * fix(web): nested corners follow their container's radius by @maria-rcks in pingdotgg/t3code#17695 * feat(web): pr panel actions confirm in place by @maria-rcks in pingdotgg/t3code#17710 * feat(web): reorder right panel tabs by dragging by @eimexdev in pingdotgg/t3code#17730 * fix(azure-devops): list pull requests with token sign-in and check out into worktrees by @maria-rcks in pingdotgg/t3code#17725 * fix(usage): keep one email in two workspaces as two accounts by @maria-rcks in pingdotgg/t3code#17711 * feat(pull-requests): hosts can report edit and resolve permissions per item by @juliusmarminge in pingdotgg/t3code#17667 * perf(server): run Git for Windows' real git.exe, not its launcher by @SunkenInTime in pingdotgg/t3code#17707 * fix(clients): restart continuations show as a T3 Code notice, not another agent's message by @juliusmarminge in pingdotgg/t3code#17723 * fix(mobile): browser picture in picture opens from the header button by @juliusmarminge in pingdotgg/t3code#17731 * feat(source-control): GitCafe lives in @t3tools/source-control-gitcafe by @juliusmarminge in pingdotgg/t3code#17681 * fix(web): add provider wizard no longer shifts sideways while it grows by @flamboh in pingdotgg/t3code#17292 * fix(web): PR search keeps the caret where you type by @flamboh in pingdotgg/t3code#17675 * fix(server): thread PR badges catch up when another environment reads the PR by @flamboh in pingdotgg/t3code#17729 * fix(server): refuse editor paths with line breaks or quotes when the editor is a Windows command shim by @juliusmarminge in pingdotgg/t3code#17749 ## New Contributors * @tiliakoos made their first contribution in pingdotgg/t3code#15537 * @Umais-Adeed made their first contribution in pingdotgg/t3code#8011 * @ZenderGoD made their first contribution in pingdotgg/t3code#14273 * @jonesfionn101-dotcom made their first contribution in pingdotgg/t3code#15188 * @ege-arhan made their first contribution in pingdotgg/t3code#15732 * @NK-Works made their first contribution in pingdotgg/t3code#16012 * @12ya made their first contribution in pingdotgg/t3code#16525 * @luke2x made their first contribution in pingdotgg/t3code#17259 * @akbarakma made their first contribution in pingdotgg/t3code#16134 * @Quicksaver made their first contribution in pingdotgg/t3code#17241 * @bitmvk made their first contribution in pingdotgg/t3code#17492 * @lastobelus made their first contribution in pingdotgg/t3code#16608 * @jfortez made their first contribution in pingdotgg/t3code#17534 * @diegoarff made their first contribution in pingdotgg/t3code#12158 * @ylcn91 made their first contribution in pingdotgg/t3code#9400 * @satyalyadav made their first contribution in pingdotgg/t3code#12038 * @vaishnavsm made their first contribution in pingdotgg/t3code#8513 * @jsilets made their first contribution in pingdotgg/t3code#11922 * @Mostafa-Ben-Git made their first contribution in pingdotgg/t3code#10509 * @UzEE made their first contribution in pingdotgg/t3code#14584 * @Lumbreras2306 made their first contribution in pingdotgg/t3code#8206 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261010.2908...v0.0.46-nightly.20261010.2922 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261010.2922
Problem
On macOS, desktop startup loads the login-shell environment, then the local backend synchronously starts another login shell to hydrate PATH. The child already inherits the prepared environment, so the second probe adds an avoidable startup wait and blocks the backend event loop.
Change
Pass an optional
shellEnvironmentPreparedflag through the existing desktop bootstrap contract. The local POSIX backend skips its duplicate PATH probe while retaining the HOME fallback. Standalone servers, older desktops, and WSL backends still hydrate their own environment; Windows retains its Node availability check and environment repair.Use the existing shared shell candidate helper in the desktop so a GUI launch without
SHELLstill reads the account's configured shell before the platform fallback. Desktop probes collect output and wait for a successful exit in the same bounded scope; failed or timed-out probes continue to the next candidate. The existing standalone server probes keep their implementation, exit-code checks, and timeouts.Scope and approval
This is maintainer-requested desktop startup performance work. Author
Yash-Singh1is listed in the upstream contribution-triage exemptions. The handoff applies to the desktop's local backend, which inherits the prepared environment. The one-class timeline focus-ring correction fixes the lint failure inherited from main.Verification
The measurements below compare baseline
b707eeb052with the handoff implementation at708dff9761. Values are medians of three launches per condition, measured from process spawn. The current revision keeps that handoff, removes the shared asynchronous probe rewrite, and fixes desktop shell selection and exit validation. These desktop timing samples predate those corrections; the final revision has not been rebenchmarked.The real-shell usable-UI range was 4.095 to 4.646 s at baseline and 3.587 to 4.114 s on this branch. With the fixed-delay shell, it was 4.664 to 5.376 s at baseline and 3.606 to 3.918 s on this branch. Quit remained around 2.1 s.
Measurements used macOS Electron 44.4.5 development builds with a bundled renderer and no compile cache. Each launch had fresh isolated state copied from an 840 KB database with 10 projects, no threads, and no pending work. Runs were sequential, with no concurrent builds or tests. Windows stayed unfocused on the built-in laptop display, with background throttling disabled consistently. The fixed-delay shell sleeps for one second before executing the environment capture command. These samples do not establish packaged warm-launch timings or performance with full production history; native Windows/Linux launches were not measured.
SHELLon macOS and Linux, account-shell fallback, rejecting valid PATH output from a shell that exits with code 7, preserving HOME fallback, Windows repair, and leaving the handoff absent for WSL.git diff --checkpassed.Individual timing samples, in seconds
Quit is measured from the quit request to OS process exit. Trials 10 through 12 are the final laptop-display batch; interrupted earlier samples are excluded.
Agents: Claude Sonnet 5.5 via T3 Code; gpt-6.1-sol via the Codex harness in T3 Code.