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
refactor(renderer): delete dead owner and settings shims - #27430
Some helper functions in the app's window code were left behind when the old way of picking "which machine runs this workspace" was retired. Nothing in the shipped app uses their results any more. This PR deletes them. The app behaves exactly the same.
What Changed
Before and after, as a user sees it: no difference.
What is removed (named exports only; every file that still has live code stays):
resolve-owner.ts: resolveOwnerWithLegacyFocus, its counter getLegacyFocusFallbackCount, and resetLegacyFocusFallbackCountForTest. Only tests called them. resolveOwner and runtimeTargetForWorkspaceOwner are unchanged.
worktree-owner-settings.ts: trySettingsForWorktreeOwner, which had no caller. With it goes settingsForWorktreeOperationRoute in worktree-operation-route.ts, whose only caller it was.
worktree-runtime-owner.ts: getSettingsForWorktreeRuntimeOwner, which only tests and two stale test mocks named. Its tests now assert getRuntimeEnvironmentIdForWorktree, the function it wrapped. The cases are the same.
repo-runtime-owner.ts: getRepoOwnerRoutedSettings and releaseRepoRuntimeOwnerSettingsCache. The first had one caller, use-work-item-source-foundation.ts, which put the result in a field nothing read. That field, and the settings subscription that fed only it, are gone. The second was test-only. getSettingsForRepoRuntimeOwner, its cache and its identity tests stay; a later PR changes those.
unstamped-non-local-row-counter.ts (whole file). This was a counter for diagnostics. worktreeMatchesHost added to it, but nothing ever read it outside tests. The match results are unchanged, and the existing match table still checks all of them.
The focus-read ratchet baseline drops by 3. That is the reads which went away with the deleted code.
Net lines: production −151 (+7/−158, including the baseline file), tests −98 (+26/−124).
Why
This is Phase 3.99 Wave 0 cleanup. Each of these helpers still looked like a live way to route an operation by the focused server. Leaving them around invites new callers. Deleting them makes the real paths (resolveOwner, getRuntimeEnvironmentIdForWorktree, getSettingsForRepoRuntimeOwner) the only ones. I deleted named exports, not whole files: resolve-owner.ts and worktree-owner-settings.ts have many live importers.
Proof the code is dead: rg for every removed name over the whole repo (src, config, scripts, tests, mobile, packages, including @ts-nocheck files) returns nothing. pnpm tc and pnpm run build:electron-vite (the renderer bundle) both pass.
Linked Issue
N/A (maintainer cleanup, Phase 3.99 Wave 0).
Visual Proof
N/A: nothing visible changes. Only dead code is removed.
Testing
pnpm tc, oxlint, pnpm run check:code-quality:changed, pnpm lint (focus-read ratchet pruned lower), pnpm run build:electron-vite
pnpm test on resolve-owner, repo-runtime-owner, worktree-runtime-owner, worktree listing slice, new-workspace, delete-worktree hydration, startup-draft-input-kind, RepositoryGitHubAccountSection: 34 files, 398 tests pass
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Security, Windows, Linux, Mac, SSH, mobile: nothing changes. No wire, IPC or persisted shape is touched. Every routing decision (local, SSH target, paired runtime, folder workspaces) goes through the same functions as before.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough
The change removes repository- and worktree-specific settings-routing helpers and updates their consumers and tests. It also removes the focus-based owner resolver and unstamped-row counter. For unhosted worktrees, host matching now returns the configured match option directly; defaults remain false for runtime and other non-local hosts and true for local hosts.
Priority: ⬇️ Low
Merge Risk:⚪ Minimal · up to fdfc9
This cleanup removes unused owner-routing helpers and legacy tracking without changing the active routing paths inspected. No merge-blocking user-facing behavior change is established.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (1 skipped: 1…
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: removing unused renderer owner and settings helpers.
Description check
The description is complete and aligned with the template. It explains the change, rationale, scope, testing, visual impact, platform considerations, and checklist status. The maintainer cleanup corre…
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: Docstring Coverage
Explanation
Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (1 skipped: 1 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
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.
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
Some helper functions in the app's window code were left behind when the old way of picking "which machine runs this workspace" was retired. Nothing in the shipped app uses their results any more. This PR deletes them. The app behaves exactly the same.
What Changed
Before and after, as a user sees it: no difference.
What is removed (named exports only; every file that still has live code stays):
resolve-owner.ts:resolveOwnerWithLegacyFocus, its countergetLegacyFocusFallbackCount, andresetLegacyFocusFallbackCountForTest. Only tests called them.resolveOwnerandruntimeTargetForWorkspaceOwnerare unchanged.worktree-owner-settings.ts:trySettingsForWorktreeOwner, which had no caller. With it goessettingsForWorktreeOperationRouteinworktree-operation-route.ts, whose only caller it was.worktree-runtime-owner.ts:getSettingsForWorktreeRuntimeOwner, which only tests and two stale test mocks named. Its tests now assertgetRuntimeEnvironmentIdForWorktree, the function it wrapped. The cases are the same.repo-runtime-owner.ts:getRepoOwnerRoutedSettingsandreleaseRepoRuntimeOwnerSettingsCache. The first had one caller,use-work-item-source-foundation.ts, which put the result in a field nothing read. That field, and thesettingssubscription that fed only it, are gone. The second was test-only.getSettingsForRepoRuntimeOwner, its cache and its identity tests stay; a later PR changes those.unstamped-non-local-row-counter.ts(whole file). This was a counter for diagnostics.worktreeMatchesHostadded to it, but nothing ever read it outside tests. The match results are unchanged, and the existing match table still checks all of them.Net lines: production −151 (+7/−158, including the baseline file), tests −98 (+26/−124).
Why
This is Phase 3.99 Wave 0 cleanup. Each of these helpers still looked like a live way to route an operation by the focused server. Leaving them around invites new callers. Deleting them makes the real paths (
resolveOwner,getRuntimeEnvironmentIdForWorktree,getSettingsForRepoRuntimeOwner) the only ones. I deleted named exports, not whole files:resolve-owner.tsandworktree-owner-settings.tshave many live importers.Proof the code is dead:
rgfor every removed name over the whole repo (src, config, scripts, tests, mobile, packages, including@ts-nocheckfiles) returns nothing.pnpm tcandpnpm run build:electron-vite(the renderer bundle) both pass.Linked Issue
N/A (maintainer cleanup, Phase 3.99 Wave 0).
Visual Proof
N/A: nothing visible changes. Only dead code is removed.
Testing
pnpm tc,oxlint,pnpm run check:code-quality:changed,pnpm lint(focus-read ratchet pruned lower),pnpm run build:electron-vitepnpm teston resolve-owner, repo-runtime-owner, worktree-runtime-owner, worktree listing slice, new-workspace, delete-worktree hydration, startup-draft-input-kind, RepositoryGitHubAccountSection: 34 files, 398 tests passI manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
Notes
Security, Windows, Linux, Mac, SSH, mobile: nothing changes. No wire, IPC or persisted shape is touched. Every routing decision (local, SSH target, paired runtime, folder workspaces) goes through the same functions as before.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)