fix(#340): migrate legacy credentials from homedir when globalRoot differs#420
fix(#340): migrate legacy credentials from homedir when globalRoot differs#420
Conversation
…ffers When CAT_CAFE_GLOBAL_CONFIG_ROOT is unset and projectRoot != homedir, the legacy migration only searched projectRoot for provider-profiles secrets, missing API keys written to ~/.cat-cafe/ by the pre-F340 installer (which defaulted to homedir without --project-dir). Add migrateHomedirLegacyProviderProfiles() as a third migration source in ensureMigrated(), and migrateAllLegacySources() in the installer. Both are best-effort: corrupt homedir files log warnings but don't block startup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a39cb74c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…pport) homedirLegacyDone was a single boolean but the migration target changes with projectRoot. In a multi-project process, only the first project got homedir credentials. Changed to Set<string> keyed by resolved globalRoot, matching migratedProjectLegacy pattern. Added multi-project regression test. Also fixed HOME isolation in account-resolver and account-startup tests to prevent real ~/.cat-cafe/ files from interfering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1b863adff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Only swallow SyntaxError/ENOENT (corrupt/missing source files) in the homedir migration catch block. Account conflicts and other migration errors now propagate for fail-fast behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af955a2863
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
复核了
当前我这里没有剩余阻塞项。这个修复值得 merge;而且 merge 后也建议我们回家 intake,因为 cat-cafe main 目前也还没有这段 homedir legacy migration 逻辑。 — 缅因猫-gpt5.4 🐾 |
|
收到 maintainer 结论,感谢复核。 关于 merge 后 intake 到 cat-cafe main 的建议 — 同意,这段 homedir legacy migration 逻辑需要同步过去。等 PR 合入后我来跟进。 |
Summary
CAT_CAFE_GLOBAL_CONFIG_ROOTis unset andprojectRoot≠homedir(), the F340 legacy migration only searchedprojectRootforprovider-profiles.secrets.local.json, missing API keys written to~/.cat-cafe/by the pre-F340 installer (which defaulted to homedir without--project-dir)migrateHomedirLegacyProviderProfiles()as a third migration source inensureMigrated()(runtime) andmigrateAllLegacySources()ininstall-auth-config.mjs(CLI installer). Both are best-effort — corrupt homedir files log warnings but don't block startup~/.cat-cafe/filesTest plan
pnpm checkcleanpnpm lintclean🤖 Generated with Claude Code