fix: address Greptile P1 findings on PR #2302

- process-registry.ts: skip the trailing notifySlotAvailable() when
  pruneDeadEntries() removed entries — prune already wakes one waiter
  per removed SDK process, so the unconditional call double-woke and
  could let two waiters spawn in the same synchronous tick, briefly
  exceeding maxConcurrent. Only fire the safety-net notify when nothing
  was pruned.
- install.ts: persistClaudeProvider() no longer silently rewrites
  CLAUDE_MEM_CLAUDE_AUTH_METHOD to 'subscription'. When called without
  an explicit auth method, preserve the existing setting; only fall
  back to 'subscription' when none is configured. Prevents re-running
  'claude-mem install --provider claude' from wiping a user's
  configured 'api-key' or 'gateway' auth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-05-04 20:43:00 -07:00
parent c4097b4ebb
commit 4e49dcf445
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -482,6 +482,7 @@ export async function waitForSlot(maxConcurrent: number): Promise<void> {
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);