diff --git a/src/npx-cli/commands/install.ts b/src/npx-cli/commands/install.ts index 7535e7f8..1f4cbbcf 100644 --- a/src/npx-cli/commands/install.ts +++ b/src/npx-cli/commands/install.ts @@ -591,10 +591,16 @@ type ClaudeApiMode = 'direct' | 'gateway'; async function promptProvider(options: InstallOptions): Promise { const initialProvider = (getSetting('CLAUDE_MEM_PROVIDER') as ProviderId) || 'claude'; - const persistClaudeProvider = (authMethod: 'subscription' | 'api-key' | 'gateway' = 'subscription') => { + const persistClaudeProvider = (authMethod?: 'subscription' | 'api-key' | 'gateway') => { + const existingAuthMethod = getSetting('CLAUDE_MEM_CLAUDE_AUTH_METHOD') as + | 'subscription' + | 'api-key' + | 'gateway' + | undefined; + const resolvedAuthMethod = authMethod ?? existingAuthMethod ?? 'subscription'; const wrote = mergeSettings({ CLAUDE_MEM_PROVIDER: 'claude', - CLAUDE_MEM_CLAUDE_AUTH_METHOD: authMethod, + CLAUDE_MEM_CLAUDE_AUTH_METHOD: resolvedAuthMethod, }); if (wrote) log.info('Saved Claude Agent SDK configuration to ~/.claude-mem/settings.json'); }; diff --git a/src/supervisor/process-registry.ts b/src/supervisor/process-registry.ts index 7e33c03f..48f72c97 100644 --- a/src/supervisor/process-registry.ts +++ b/src/supervisor/process-registry.ts @@ -482,6 +482,7 @@ export async function waitForSlot(maxConcurrent: number): Promise { const removed = getProcessRegistry().pruneDeadEntries(); if (removed > 0) { logger.info('PROCESS', 'Pruned stale process registry entries while waiting for agent slot', { removed }); + return; } notifySlotAvailable(); }, SLOT_RECHECK_INTERVAL_MS);