feat: Add verbose mode with worker lifecycle monitoring and improved error handling

Adds --verbose flag to init and index commands that shows timestamped progress output instead of animated progress bars. Implements worker timeout protection (10s per file) and periodic worker recycling (every 500 files) to prevent WASM memory crashes from hanging the entire indexing process. Includes detailed logging of worker lifecycle events and memory usage for debugging large repository indexing issues.
This commit is contained in:
Colby McHenry
2026-04-04 22:28:25 -05:00
parent 64d844c938
commit c19c0ca8fd
3 changed files with 223 additions and 46 deletions
+4 -1
View File
@@ -115,6 +115,9 @@ export interface IndexOptions {
/** Abort signal for cancellation */
signal?: AbortSignal;
/** Enable verbose logging (worker lifecycle, memory, timeouts) */
verbose?: boolean;
}
/**
@@ -383,7 +386,7 @@ export class CodeGraph {
return { success: false, filesIndexed: 0, filesSkipped: 0, filesErrored: 0, nodesCreated: 0, edgesCreated: 0, errors: [{ message: 'Could not acquire file lock - another process may be indexing', severity: 'error' as const }], durationMs: 0 };
}
try {
const result = await this.orchestrator.indexAll(options.onProgress, options.signal);
const result = await this.orchestrator.indexAll(options.onProgress, options.signal, options.verbose);
// Resolve references to create call/import/extends edges
if (result.success && result.filesIndexed > 0) {