fix(auth): use unified config for account profile touch in ccs.ts

Account profiles in unified config mode were failing with "Profile not found"
because touchProfile() only checked legacy profiles.json. Now checks unified
config first with hasAccountUnified() and calls touchAccountUnified() when
the profile exists there, falling back to legacy touchProfile() otherwise.

Fixes #98
This commit is contained in:
kaitranntt
2025-12-14 01:17:22 -05:00
parent 13d535e901
commit 4ccde8a3f0
+6 -2
View File
@@ -397,8 +397,12 @@ async function main(): Promise<void> {
// Ensure instance exists (lazy init if needed) // Ensure instance exists (lazy init if needed)
const instancePath = instanceMgr.ensureInstance(profileInfo.name); const instancePath = instanceMgr.ensureInstance(profileInfo.name);
// Update last_used timestamp // Update last_used timestamp (check unified config first, fallback to legacy)
registry.touchProfile(profileInfo.name); if (registry.hasAccountUnified(profileInfo.name)) {
registry.touchAccountUnified(profileInfo.name);
} else {
registry.touchProfile(profileInfo.name);
}
// Execute Claude with instance isolation // Execute Claude with instance isolation
const envVars: NodeJS.ProcessEnv = { CLAUDE_CONFIG_DIR: instancePath }; const envVars: NodeJS.ProcessEnv = { CLAUDE_CONFIG_DIR: instancePath };