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(claude-accounts): organize sign-in and profile owners - #41222
Claude account code now groups sign-in, account selection, runtime authentication and profile setup by their concrete owners. Callers import the defining modules directly.
Files
Added
Deleted
Net
Test
34
$\color{#1a7f37}{\Huge{\mathbf{+}}}$56
$\color{#cf222e}{\Huge{\mathbf{−}}}$2462
$\color{#cf222e}{\Huge{\mathbf{−}}}$2406
Prod
107
$\color{#1a7f37}{\Huge{\mathbf{+}}}$256
$\color{#cf222e}{\Huge{\mathbf{−}}}$265
$\color{#cf222e}{\Huge{\mathbf{−}}}$9
What Changed
Move 56 files, including 39 production modules, into sign-in, selection, runtime-auth and profile configuration/routing/setup/WSL folders. Keep the substantive account and runtime-auth services at their existing boundaries.
Remove the borrowed ClaudeRuntimeAuthPreparation type export and route its five consumers directly to the defining type module. No barrels or compatibility aliases.
Move source entry paths for the profile setup worker and WSL helper while preserving their emitted executable names and protocols. Update the CLI keychain source/output entry together with the moved CLI import.
Apply repository test policy: retire 47 complete registrations, including nine whole Programs. Preserve all 77 retained registrations and their callbacks/setup through path moves and formatting. Eleven registrations already removed upstream receive zero new retirement credit.
Why
The flat directory mixed browser sign-in, local credentials, profile storage and provisioning, environment selection and guest process boundaries. Concrete ownership folders make those dependencies visible while keeping module initialization and application behavior intact.
Linked Issue
Maintainer-requested module layout cleanup; no separate issue.
Visual Proof
N/A — production rendering and interaction behavior are preserved.
Testing
Full pnpm tc and the owning selection pass after rebasing onto main ee6b0858cf7 (current head f0b4fbca1a0): 28 suites / 94 passed examples / one skipped, two workers, per-file isolation, background launch and the canonical macOS temporary directory.
Fresh CLI and WSL guest builds pass on this head. Production Electron build and built CLI account --help passed on preceding reviewed sources; fresh hosted packaging remains required. The native parent-agent environment fix is preserved in all four overlapping owners.
The freshly built CLI account --help passes. The production WSL helper is byte-identical: 75,020 bytes, SHA256 1b51e75f944e793d7223a29320e4d135d3c1b83872e0d6e27a359d3057c1cd80. Browser helper contents and worker executable names are unchanged.
Two completed broad pnpm check:changed runs on the preceding head passed 33/34 checks; the related unit selection failed 48 examples. The retained logs identify 15 failures across seven agent-hook persistence Programs. Those same 15 failures reproduce on pristine dc13df69626, including per-file isolation, while all 35 examples pass under Node. The failures reopen WAL-backed SQLite files under Bun/macOS. The omitted 33 failures are not classified by this control.
The immediate pre-push pnpm check:changed --base=origin/main --timeout=1 --maxWorkers=2 passes all 33 non-unit checks on this rebased head; the broad related-unit selection times out at its declared one-minute limit. This is a disclosed scoped-check exception, not a passing unit result. Current full typecheck, 28 owning suites and independent source/native audits provide scoped evidence; fresh required hosted CI must pass before merge.
Independent source audits compare production bodies, literals, import phases, canonical singletons, resource/build contacts and retained registration callbacks/setup/fixtures. The final rebase audit preserves all 478 native changed paths since the prior published base, including 394 deletions and all 67 browser changes; all 195 nonmetadata authored entries match the previously reviewed candidate. Two overlapping test-selection metadata changes compose correctly; 1,476 resolved imports show zero drift. The earlier parked-split CI blocker is repaired in merged fix(terminal): preserve host focus when CLI splits a parked tab #41203.
Risk
Level: Low for production. A missed import or compiled entry could interrupt account sign-in, profile preparation or agent startup. Full typechecking/builds, existing public behavior tests, generated-output comparison and independent source/resource audits cover these boundaries. A plain revert restores the former layout.
Test retirement intentionally reduces coverage under repository policy. Some removed mixed-value cases exercised account routing, real CLI sign-in, usage scanning and structured-session failure handling. No replacement coverage is claimed. Whole cases retire; retained assertions are preserved. The file/junction occupied-home regression case also retires because it branches inside a parameterized body and uses an unpinned throw expectation. Its personal-data and marker-preservation coverage is lost; production ownership guards remain source-identical, and no replacement coverage is claimed.
Review
The existing installed profile router, runtime-auth preparation boundary, browser helper, worker messaging and WSL invocation retain their initialization and execution order. Persisted profile paths, credential identities and public protocols are unchanged. All reviewed production blobs and modes survive exactly relative to the candidate that already incorporates the native parent-agent environment fix. Both overlapping test-selection files combine the reviewed cleanup with newer main changes; upstream test removals stay removed.
Agent skill upstream boundary
Not applicable: no upstream skill-installer material.
Notes
Reviewed macOS, Linux, Windows, WSL, SSH, mobile and folder workspaces. Platform guards and process wrappers are unchanged. No new polling, subprocesses, credentials, storage or UI behavior.
Checklist
One cohesive Claude account ownership batch
Change, rationale and risks explained
Visual proof marked N/A with reason
Correctness, credential boundaries, initialization and performance reviewed
Cross-platform, remote, mobile and folder workspace impact considered
Tests, typecheck and builds recorded; changed gate limitation disclosed; hosted CI required before merge
Claude account modules were reorganized into sign-in, profiles, runtime-auth, and selection subdirectories. Imports and build entry points were updated to use the new paths. The diff also removes multiple tests and updates test selection, timing, and baseline configuration.
Merge Risk: Low · up to f0b4f
This is a module reorganization with no intended behavior change. The risk is reduced regression coverage for account profile safety after tests were retired. Restore key coverage or accept the gap, and wait for hosted CI before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: reorganizing Claude account modules by sign-in and profile ownership.
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.
Description check
The description follows the repository template and covers the main required sections. The ELI5, What Changed, Why, Testing, Risk, Review, and Checklist sections are all filled in. It states the scope…
Full details: Description check
Explanation
The description follows the repository template and covers the main required sections. The ELI5, What Changed, Why, Testing, Risk, Review, and Checklist sections are all filled in. It states the scope (moving 56 files into ownership folders and removing the borrowed ClaudeRuntimeAuthPreparation re-export), the mechanism, a risk level (Low for production), and a rollback path (a plain revert). The Testing section gives concrete commands, results, and a disclosed limitation: the changed-files gate timed out on the related unit selection, and fresh hosted CI is still required. Gaps: the Linked Issue section says 'no separate issue' and does not use the template's 'Fixes #' form, and the Visual Proof is N/A with a reason. The Testing section also reports a mix of preceding-head and current-head results, which makes it harder to tell what was verified on the final head. The AI Disclosure section is left blank, which the template allows only for internal team members. Overall the description is mostly complete and specific.
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.
The deleted test checks that setup rejects a file or junction at the profile home and preserves the marker and personal data. Retain this regression coverage for the filesystem ownership boundary.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 3c1a6f2a-cf71-4651-a81e-425a5bba91ea
Commits
Reviewing files that changed from the base of the PR and between ebe264c and 7f735d9.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
This deletion removes the parameterized checks that setup refuses a file or symlink at the profile home while preserving the completion marker and personal data. Restore both cases at the relocated path. These assertions protect the ownership boundary against destructive setup regressions.
Based on the supplied change details, this test covered both occupied-home forms and their preservation guarantees.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1d85c1f1-08c4-4189-85fe-c52ac4ee0aca
Commits
Reviewing files that changed from the base of the PR and between 7f735d9 and f0b4fbc.
Files skipped from review as they are similar to previous changes: 1
src/main/window/attach-main-window-services.ts
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
Claude account code now groups sign-in, account selection, runtime authentication and profile setup by their concrete owners. Callers import the defining modules directly.
What Changed
ClaudeRuntimeAuthPreparationtype export and route its five consumers directly to the defining type module. No barrels or compatibility aliases.Why
The flat directory mixed browser sign-in, local credentials, profile storage and provisioning, environment selection and guest process boundaries. Concrete ownership folders make those dependencies visible while keeping module initialization and application behavior intact.
Linked Issue
Maintainer-requested module layout cleanup; no separate issue.
Visual Proof
N/A — production rendering and interaction behavior are preserved.
Testing
pnpm tcand the owning selection pass after rebasing onto mainee6b0858cf7(current headf0b4fbca1a0): 28 suites / 94 passed examples / one skipped, two workers, per-file isolation, background launch and the canonical macOS temporary directory.account --helppassed on preceding reviewed sources; fresh hosted packaging remains required. The native parent-agent environment fix is preserved in all four overlapping owners.account --helppasses. The production WSL helper is byte-identical: 75,020 bytes, SHA2561b51e75f944e793d7223a29320e4d135d3c1b83872e0d6e27a359d3057c1cd80. Browser helper contents and worker executable names are unchanged.pnpm check:changedruns on the preceding head passed 33/34 checks; the related unit selection failed 48 examples. The retained logs identify 15 failures across seven agent-hook persistence Programs. Those same 15 failures reproduce on pristinedc13df69626, including per-file isolation, while all 35 examples pass under Node. The failures reopen WAL-backed SQLite files under Bun/macOS. The omitted 33 failures are not classified by this control.pnpm check:changed --base=origin/main --timeout=1 --maxWorkers=2passes all 33 non-unit checks on this rebased head; the broad related-unit selection times out at its declared one-minute limit. This is a disclosed scoped-check exception, not a passing unit result. Current full typecheck, 28 owning suites and independent source/native audits provide scoped evidence; fresh required hosted CI must pass before merge.Risk
Level: Low for production. A missed import or compiled entry could interrupt account sign-in, profile preparation or agent startup. Full typechecking/builds, existing public behavior tests, generated-output comparison and independent source/resource audits cover these boundaries. A plain revert restores the former layout.
Test retirement intentionally reduces coverage under repository policy. Some removed mixed-value cases exercised account routing, real CLI sign-in, usage scanning and structured-session failure handling. No replacement coverage is claimed. Whole cases retire; retained assertions are preserved. The file/junction occupied-home regression case also retires because it branches inside a parameterized body and uses an unpinned throw expectation. Its personal-data and marker-preservation coverage is lost; production ownership guards remain source-identical, and no replacement coverage is claimed.
Review
The existing installed profile router, runtime-auth preparation boundary, browser helper, worker messaging and WSL invocation retain their initialization and execution order. Persisted profile paths, credential identities and public protocols are unchanged. All reviewed production blobs and modes survive exactly relative to the candidate that already incorporates the native parent-agent environment fix. Both overlapping test-selection files combine the reviewed cleanup with newer main changes; upstream test removals stay removed.
Agent skill upstream boundary
Notes
Reviewed macOS, Linux, Windows, WSL, SSH, mobile and folder workspaces. Platform guards and process wrappers are unchanged. No new polling, subprocesses, credentials, storage or UI behavior.
Checklist