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
{{ message }}
Repository navigation
perf: avoid building launch routes for preference reads - #41803
Reading agent launch preferences now resolves only which host owns those preferences, instead of building and discarding a complete launch route.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$11
$\color{#cf222e}{\Huge{\mathbf{−}}}$6
$\color{#1a7f37}{\Huge{\mathbf{+}}}$5
What Changed
Extract the existing owner/execution-host resolution into resolveAgentLaunchOwner. Both the full launch host resolver and launch preference reader reuse it. Actual launch routes retain their capability and routing construction.
Why
The terminal keyboard owner reaches this reader through handleTerminalWorkspaceKeyDown → resolveTerminalAgentTabShortcut → readAgentTabShortcutActions, including nonrepeat keys that do not match a shortcut. UI and async preference readers also reach it. Previously each read constructed project/transcript/capability/catalog fields solely to use executionHostId.
Introduced by f4a1b05 (#31971). Exact-source controls at installed e58bf50 and base ddf4aa8 show 100/1,000 reads build 100/1,000 full routes and read a staged four-agent catalog 400/4,000 times. Afterward those discarded operations are zero; required owner resolutions are unchanged. These are staged seam counts, not the live catalog population or a latency measurement. This does not establish the cause of observed input stalls.
External exact-source controls at installed/base/after: 100 and 1,000 reads over local, paired runtime, SSH and ambiguous ownership.
External hardcoded correctness controls: 12 cases / 96 assertions on both base and after, including local/WSL/folder/floating, paired/SSH, prospective hosts and execution contexts.
Final pnpm check:changed: 28/29 checks pass (including typecheck, lint, formatting and ratchets). Broad related-unit selection was stopped after 365 seconds to bound host load; its captured output includes localhost:3000 ECONNREFUSED errors. The broad suite did not complete; no full-suite pass is claimed.
macOS validation only. Staged host cases do not establish native Windows/Linux or live SSH performance. No app restart, input injection, transport change or new repository tests.
Risk
Level: Low. Host ownership is the sensitive boundary: an incorrect extraction could read another host’s preferences. The owner and fallback expression are unchanged and shared with actual launch routing; the parity controls cover their precedence. No persistence or protocol changes. Plain revert restores previous behavior.
Agent skill upstream boundary
Not applicable; no upstream skill source copied.
Checklist
Small and focused; self-reviewed for correctness and performance.
Cross-platform, folder, SSH/remote and mobile ownership considered.
No presentation changes; visual proof N/A.
Full build and native platform checks left to CI/review.
No actionable comments were generated in the recent review.
Walkthrough
A new resolveAgentLaunchOwner helper resolves the structured-session owner for worktree launches and returns it with the selected execution host ID. resolveAgentLaunchHost now uses the helper and retains its existing return behavior. Workspace preference selection also uses the helper to determine the execution host.
Merge Risk: Minimal · up to 791c4
This change avoids building launch routes when only the owning host is needed for preference reads. No behavioral regression was identified, so it looks safe to merge after normal checks.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "perf: avoid building launch routes for preference reads" matches the main change: owner/execution-host resolution is extracted into resolveAgentLaunchOwner, and the preference reader no lon…
Description check
The description follows the template. It has the ELI5, What Changed, Why, Linked Issue, Visual Proof (N/A with reason), Testing, Risk (Low, with rollback stated), AI Disclosure section, and checklist.…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "perf: avoid building launch routes for preference reads" matches the main change: owner/execution-host resolution is extracted into resolveAgentLaunchOwner, and the preference reader no longer builds a full launch route it discards. It uses a conventional prefix and stays concise.
Full details: Description check
Explanation
The description follows the template. It has the ELI5, What Changed, Why, Linked Issue, Visual Proof (N/A with reason), Testing, Risk (Low, with rollback stated), AI Disclosure section, and checklist. The Linked Issue section says 'Performance investigation; no separate issue' and does not contain an issue reference such as 'Fixes #'. The template requires an actual linked issue for outside contributors, so that section is incomplete. The Testing checkboxes for manual testing and automated tests are unchecked, and the Review and Agent skill sections are only partly addressed. Most sections are complete, so the check passes, but the missing issue link should be resolved.
Resolution
Consider adding an actual linked issue (or confirming the maintainer exemption) in the Linked Issue section. Also clarify the unchecked Testing items, since the author states no new repository tests were added.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Reading agent launch preferences now resolves only which host owns those preferences, instead of building and discarding a complete launch route.
What Changed
Extract the existing owner/execution-host resolution into
resolveAgentLaunchOwner. Both the full launch host resolver and launch preference reader reuse it. Actual launch routes retain their capability and routing construction.Why
The terminal keyboard owner reaches this reader through
handleTerminalWorkspaceKeyDown→resolveTerminalAgentTabShortcut→readAgentTabShortcutActions, including nonrepeat keys that do not match a shortcut. UI and async preference readers also reach it. Previously each read constructed project/transcript/capability/catalog fields solely to useexecutionHostId.Introduced by f4a1b05 (#31971). Exact-source controls at installed e58bf50 and base ddf4aa8 show 100/1,000 reads build 100/1,000 full routes and read a staged four-agent catalog 400/4,000 times. Afterward those discarded operations are zero; required owner resolutions are unchanged. These are staged seam counts, not the live catalog population or a latency measurement. This does not establish the cause of observed input stalls.
Linked Issue
Performance investigation; no separate issue.
Visual Proof
N/A — no visual or interaction behavior changes.
Testing
pnpm check:changed: 28/29 checks pass (including typecheck, lint, formatting and ratchets). Broad related-unit selection was stopped after 365 seconds to bound host load; its captured output includes localhost:3000 ECONNREFUSED errors. The broad suite did not complete; no full-suite pass is claimed.Risk
Level: Low. Host ownership is the sensitive boundary: an incorrect extraction could read another host’s preferences. The owner and fallback expression are unchanged and shared with actual launch routing; the parity controls cover their precedence. No persistence or protocol changes. Plain revert restores previous behavior.
Agent skill upstream boundary
Checklist