can1357/oh-my-pi · error · Error
Split commit plan missing staged files: ${missingFiles.join(
Error message
Split commit plan missing staged files: ${missingFiles.join(", ")} What it means
runSplitCommit() verifies that every staged file is covered by the agent's split-commit plan. It diffs `repo.changedFiles({cached:true})` against the union of all plan commit changes (plus lock files re-assigned via assignLockFilesToPlan). Any staged path absent from the plan causes this throw, preventing commits that would silently drop staged changes.
Source
Thrown at packages/coding-agent/src/commit/agentic/index.ts:283
}
async function runSplitCommit(
plan: SplitCommitPlan,
ctx: CommitExecutionContext & { additionalFiles?: string[] },
): Promise<void> {
const repo = vcs.requireGit(ctx.cwd);
if (plan.warnings.length > 0) {
process.stdout.write(formatWarnings(plan.warnings));
}
if (ctx.additionalFiles && ctx.additionalFiles.length > 0) {
appendFilesToLastCommit(plan, ctx.additionalFiles);
}
const stagedFiles = await repo.changedFiles({ cached: true });
assignLockFilesToPlan(plan, stagedFiles);
const plannedFiles = new Set(plan.commits.flatMap(commit => commit.changes.map(change => change.path)));
const missingFiles = stagedFiles.filter(file => !plannedFiles.has(file));
if (missingFiles.length > 0) {
throw new Error(`Split commit plan missing staged files: ${missingFiles.join(", ")}`);
}
if (ctx.dryRun) {
process.stdout.write("\nSplit commit plan (dry run):\n");
for (const [index, commit] of plan.commits.entries()) {
const analysis: ConventionalAnalysis = {
type: commit.type,
scope: commit.scope,
details: commit.details,
issueRefs: commit.issueRefs,
};
const message = formatCommitMessage(analysis, commit.summary);
process.stdout.write(`Commit ${index + 1}:\n${message}\n`);
const changeSummary = commit.changes.map(change => formatFileChangeSummary(change.path, change)).join(", ");
process.stdout.write(`Changes: ${changeSummary}\n`);
}
return;
}View on GitHub (pinned to 9690622007)
Solutions
- Re-run the commit flow so the plan is regenerated against the current staged set
- Unstage the offending files (`git restore --staged <file>`) if they should not be committed
- File/inspect the split plan output — the error lists the exact missing paths; verify the agent saw them
- Use a single-commit flow instead of split mode if the plan keeps diverging
Example fix
// before (files staged after plan generation) $ omp commit --split & git add src/new.ts // after: stage everything first, then commit $ git add -A && omp commit --split
Defensive patterns
Strategy: validation
Validate before calling
const staged = await repo.changedFiles({ cached: true });
const planned = new Set(plan.commits.flatMap(c => c.changes.map(ch => ch.path)));
const missing = staged.filter(f => !planned.has(f));
if (missing.length) console.warn("Plan will miss:", missing); Try / catch
try {
await runSplitCommit(plan, ctx);
} catch (err) {
if (err.message.startsWith("Split commit plan missing staged files:")) {
const files = err.message.split(": ")[1].split(", ");
await git.restoreStaged(files); // unstage and retry or commit separately
} else throw err;
} Prevention
- Stage all files before starting the agentic commit, not during
- Regenerate the plan after any manual `git add`
- Review the printed split plan before confirming
When it happens
Trigger: The model's SplitCommitPlan omits one or more files that are currently staged (git add happened after plan generation, or the LLM hallucinated an incomplete file list), and assignLockFilesToPlan() could not absorb the missing paths.
Common situations: Files staged while the agent was still analyzing; agent plan built from stale `git status`; IDE auto-staging new files mid-run; lockfile reassignment failing because the missing file is not a lockfile.
Related errors
- error
- Generated commit message failed validation: ${generated.vali
- Unsupported language '{value}'. Supported: {}
- Unable to infer language from file extension: {}. Specify `l
- Invalid pattern: {err}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/79f05772f628d63d.
Report an issue: GitHub.