Repository navigation
fix(claude-accounts): persist profile model and effort settings across launches (#36850) - #37091
hrithiksaini99 wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 2

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:
e21e41e9-2b6c-4c4b-90b7-e1c6b542e1bb
Files selected for processing: 3-
src/main/claude-accounts/claude-profile-provisioning.test.tssrc/main/claude-accounts/claude-profile-provisioning.tssrc/main/claude-accounts/claude-profile-settings.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
…es when global settings absent
There was a problem hiding this comment.
Actionable comments posted: 3

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:
0657ba0e-7601-427a-8b60-b05d8e150bb3
Files selected for processing: 3-
src/main/claude-accounts/claude-credential-persistence-ratchet.test.tssrc/main/claude-accounts/claude-profile-provisioning.test.tssrc/main/claude-accounts/claude-profile-settings.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
… on global deletion
|
Thanks for digging into this, @hrithiksaini99. #38219 fixed it with a per-key sync record, so model, effort and any other setting Claude saves in an account now survive, and later ~/.claude edits still reach the account. Closing this one in favour of it. |
Fixes #36850
Cause
When using a managed Claude account, running
/modelor changing model reasoning effort (e.g./effort high) savesmodelSettingsand/oreffortLevelinto the managed profile's<profile>/settings.json.However,
copySettingsinsrc/main/claude-accounts/claude-profile-provisioning.tsran on every session launch and compared~/.claude/settings.jsonwith<profile>/settings.jsonignoring only Orca hooks. Because~/.claude/settings.jsonlacked the profile'smodelSettingsor had different effort levels,copySettingstreated the profile as having drifted and blindly copied~/.claude/settings.jsonover<profile>/settings.json, discarding the user's/modeland effort choices on every launch. In addition, symlinked settings were not treated asuser-ownedbefore attempting a copy.Solution
claude-profile-settings.ts, updated the settings comparison to exclude profile-managed model/effort settings (modelSettingsandeffortLevel) alongside Orca's hooks, so that sessions do not needlessly overwritesettings.jsonon every launch.copySettings, when global~/.claude/settings.jsonupdates (e.g. adding user hooks, permissions, or proxies), preserve and merge the profile's existingmodelSettingsandeffortLevelinto the target settings.<profile>/settings.jsonasuser-owned.copySettingsintosrc/main/claude-accounts/claude-profile-settings.tsto keepclaude-profile-provisioning.tswell within lint file line limits.modelSettingsandeffortLevelpersist across provisioning runs and merge properly when~/.claude/settings.jsonupdates.Verification
pnpm vitest run src/main/claude-accounts/claude-profile-provisioning.test.ts(all 16 tests passed).src/main/claude-accounts/(all 202 tests passed).pnpm tc:node(passed with 0 errors).pnpm exec oxlintandpnpm exec oxfmt --check(passed with 0 warnings/errors).