Problem
When brain_ingest processes a large or slow file, the progress bar stalls (e.g., at 10.8%) with no indication of WHICH file is being processed. This makes it impossible to diagnose whether a binary file slipped through detection or a legitimate text file is just slow to chunk/embed.
Solution
1. Extend ProgressCallback to include current file path
In src/ingest/index.ts, change the progress callback:
export interface ProgressUpdate {
current: number;
total: number;
currentFile?: string; // file currently being processed
currentFileSize?: number; // size in bytes
}
export interface IngestOptions {
// ...
progressCallback?: (update: ProgressUpdate) => void;
}
2. Call progress callback at file start
In processFile(), right before reading the file, fire a progress update with currentFile set:
options?.progressCallback?.({ current: i + 1, total: walkedFiles.length, currentFile: filePath, currentFileSize: fileStats.size });
3. Add "slow file" warning
If a file takes >10 seconds to process, log a warning via log():
if (elapsed > 10_000) {
log("warn", "ingest`, `Slow file (${(elapsed / 1000).toFixed(1)}s): ${filePath}`);
}
4. Log when file is skipped (too large / binary)
Log at info level when skipping large or binary files so the user can see what's being excluded:
log("info", "ingest`, `Skipped (too large, ${(fileStats.size / 1024 / 1024).toFixed(1)}MB): ${filePath}`);
log("info", "ingest`, `Skipped (binary content): ${filePath}`);
Files
src/ingest/index.ts — extend ProgressCallback + add file-path reporting
Problem
When
brain_ingestprocesses a large or slow file, the progress bar stalls (e.g., at 10.8%) with no indication of WHICH file is being processed. This makes it impossible to diagnose whether a binary file slipped through detection or a legitimate text file is just slow to chunk/embed.Solution
1. Extend
ProgressCallbackto include current file pathIn
src/ingest/index.ts, change the progress callback:2. Call progress callback at file start
In
processFile(), right before reading the file, fire a progress update withcurrentFileset:3. Add "slow file" warning
If a file takes >10 seconds to process, log a warning via
log():4. Log when file is skipped (too large / binary)
Log at info level when skipping large or binary files so the user can see what's being excluded:
Files
src/ingest/index.ts— extend ProgressCallback + add file-path reporting