fix: harden daemon and large-index recovery paths (#1562)

* fix: harden indexing recovery and daemon liveness

* test: cover daemon and recovery review gaps

* test: pin that a failure marker never blocks a later successful parse (#1557 retry-discard guard)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: danusha2345 <ewidusoc498@gmail.com>
Co-authored-by: Colby McHenry <me@colbymchenry.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniil
2026-08-20 12:53:49 -05:00
committed by GitHub
co-authored by Claude Fable 5 danusha2345 Colby McHenry
parent d8f2eeaddf
commit 81e1f4a92f
20 changed files with 680 additions and 83 deletions
+11 -10
View File
@@ -1708,10 +1708,10 @@ program
.aliases(['daemons'])
.description('Manage running CodeGraph background daemons — pick one and press enter to stop it')
.action(async () => {
const { listDaemons, stopDaemonAt, stopAllDaemons } = await import('../mcp/daemon-registry');
const { listVerifiedDaemons, stopDaemonAt, stopAllDaemons } = await import('../mcp/daemon-registry');
const { runDaemonPicker } = await import('../mcp/daemon-manager');
const daemons = listDaemons();
const daemons = await listVerifiedDaemons();
if (daemons.length === 0) {
info('No CodeGraph daemons running.');
return;
@@ -1734,7 +1734,7 @@ program
const clack = await importESM('@clack/prompts');
clack.intro('CodeGraph daemons');
await runDaemonPicker({
list: listDaemons,
list: listVerifiedDaemons,
stop: stopDaemonAt,
stopAll: stopAllDaemons,
cwdRoot,
@@ -1840,14 +1840,15 @@ program
}
const lockPath = path.join(getCodeGraphDir(projectPath), 'codegraph.lock');
if (!fs.existsSync(lockPath)) {
info(`No lock file found ${getGlyphs().dash} nothing to do`);
return;
let removed = false;
if (fs.existsSync(lockPath)) {
fs.unlinkSync(lockPath);
removed = true;
}
fs.unlinkSync(lockPath);
success('Removed lock file. You can now run indexing again.');
const { clearStaleDaemonArtifacts } = await import('../mcp/daemon-registry');
removed = await clearStaleDaemonArtifacts(projectPath) || removed;
if (removed) success('Removed stale lock artifacts. You can now run indexing again.');
else info(`No stale lock files found ${getGlyphs().dash} nothing to do`);
} catch (err) {
error(`Failed to remove lock: ${err instanceof Error ? err.message : String(err)}`);
process.exit(1);