can1357/oh-my-pi · error · Error
No relevant files to summarize after filtering
Error message
No relevant files to summarize after filtering
What it means
The map-reduce analysis pipeline filters the diff down to files relevant for the commit analysis (via includedFiles over the parsed prompt diff). If no files survive that filter, there is nothing for the map phase to summarize, so runMapReduce throws instead of producing an empty analysis.
Source
Thrown at packages/coding-agent/src/commit/conventional/map-reduce.ts:64
}
/** Group non-binary file indices into greedy LLM batches. */
export function buildLlmFileBatches(files: readonly ConventionalFileDiff[], budget: number): number[][] {
const indices: number[] = [];
for (let index = 0; index < files.length; index += 1) if (!files[index]?.isBinary) indices.push(index);
return buildBatchesForIndices(files, indices, budget);
}
/** Run exact per-file observation mapping followed by one reduce synthesis call. */
export async function runMapReduce(input: {
inference: CommitInference;
config: ConventionalGenerationConfig;
stat: string;
diff: string;
scopeCandidates: string;
}): Promise<ConventionalAnalysis> {
const files = includedFiles(parsePromptDiff(input.diff), input.config);
if (files.length === 0) throw new Error("No relevant files to summarize after filtering");
const observations = await mapPhase(files, input.inference, input.config);
const prompts = renderConventionalPrompt("reduce", {
types_description: formatTypesDescription(),
observations: renderObservationsMarkdown(observations),
stat: condenseStat(input.stat),
scope_candidates: input.scopeCandidates,
});
return input.inference.complete(
{
operation: "map-reduce/reduce",
role: "analysis",
promptFamily: "reduce",
systemPrompt: prompts.system,
userPrompt: prompts.user,
toolName: "create_conventional_analysis",
progressLabel: "Reducing file observations…",
},
response => parseConventionalAnalysisMarkdown(response.text),View on GitHub (pinned to 9690622007)
Solutions
- Broaden the file filter patterns in the generation config so the changed files qualify
- Stage actual source changes, not only lockfiles/generated files
- Pass the full diff text (verify it contains 'diff --git' file headers)
- Fall back to direct (non-map-reduce) analysis for filter-only commits
Example fix
// before
const analysis = await runMapReduce({ diff, config });
// after: guard with fallback
const files = includedFiles(parsePromptDiff(diff), config);
const analysis = files.length > 0
? await runMapReduce({ diff, config })
: await generateDirectAnalysis({ diff, config }); Defensive patterns
Strategy: validation
Validate before calling
const files = includedFiles(parsePromptDiff(diff), config);
if (files.length === 0) {
// fall back to direct analysis or abort with a clear message
} Type guard
function hasMapReduceInput(diff: string, config: Config): boolean {
return includedFiles(parsePromptDiff(diff), config).length > 0;
} Try / catch
try {
return await runMapReduce(input);
} catch (err) {
if (err instanceof Error && err.message.startsWith("No relevant files")) {
return generateDirectAnalysis(input); // fallback path
}
throw err;
} Prevention
- Keep file-filter globs permissive enough for your repo's source layout
- Check git status/diff before invoking generation
- Fall back to direct analysis when the diff is filter-only (lockfiles, generated code)
When it happens
Trigger: Calling runMapReduce (directly or via analysis/generateAnalysisWithMapReduce) when parsePromptDiff(input.diff) yields files that are all excluded by the config's file filter — e.g. the diff contains only ignored paths (lockfiles, generated files, binary files) or the diff is malformed so no filenames parse out.
Common situations: Commits touching only package-lock.json / bun.lock / generated artifacts, config's relevant-file globs too restrictive, passing a truncated or context-only diff with no file headers, or a custom ConventionalGenerationConfig whose filter excludes everything.
Related errors
- modified change requires peer root
- Missing map observation for ${files[index]?.filename ?? "unk
- Diff does not contain any lines
- Line numbers in @@ header must be >= 1
- Line hint must be >= 1
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/f3c9bf73442f86d6.
Report an issue: GitHub.