refactor(config): DRY precedence logic, dynamic recovery messages, CCS_HOME cloud warning

- Extract shared _resolveCcsDir() to prevent getCcsDir/getCcsDirSource divergence
- Replace all hardcoded ~/.ccs/ and ~/.claude/ in recovery-manager.ts with
  dynamic paths from instance properties (ccsDir, claudeDir, sharedDir, etc.)
- Add cloud sync detection for CCS_HOME env var (parity with CCS_DIR/--config-dir)
- Cache getSessionSecretPath() in local var in auth-middleware.ts
- Cache getCacheDir() in local var in disk-cache.ts ensureCacheDir()
This commit is contained in:
Tam Nhu Tran committed 2026-02-11 11:52:30 +07:00
1 parent c8800b418a
commit 9699e01725
5 files changed
+41 -24

No files matched your search

+8
View File
@@ -318,6 +318,14 @@ async function main(): Promise<void> {
console.error(warn(`CCS directory is under ${cloudService}.`));
console.error(' OAuth tokens in cliproxy/auth/ will be synced to cloud.');
}
} else if (process.env.CCS_HOME) {
// Also warn for CCS_HOME env var pointing to cloud sync
const { detectCloudSyncPath } = await import('./utils/config-manager');
const cloudService = detectCloudSyncPath(process.env.CCS_HOME);
if (cloudService) {
console.error(warn(`CCS directory is under ${cloudService}.`));
console.error(' OAuth tokens in cliproxy/auth/ will be synced to cloud.');
}
}
const firstArg = args[0];