{"record":{"id":"518d7ec0276d5829","repo":"gitbutlerapp/gitbutler","slug":"the-model-returned-no-resolution-for-the-conflicte","errorCode":null,"errorMessage":"The model returned no resolution for the conflicted file \"{}\"","messagePattern":"The model returned no resolution for the conflicted file \"(.+?)\"","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-api/src/resolve/mod.rs","lineNumber":661,"sourceCode":"            apply::ensure_no_markers(&hunk.resolved_content, &file.path)?;\n            picks[index].insert(\n                hunk_index,\n                apply::HunkPick::Content(hunk.resolved_content.clone()),\n            );\n        }\n        resolved_files[index] = Some(ResolvedFile {\n            path: file.path.clone(),\n            hunks: resolution\n                .hunks\n                .iter()\n                .map(|hunk| hunk.resolved_content.clone())\n                .collect(),\n            reasoning: resolution.reasoning.clone(),\n        });\n    }\n\n    if let Some(missing) = resolved_files.iter().position(Option::is_none) {\n        bail!(\n            \"The model returned no resolution for the conflicted file \\\"{}\\\"\",\n            request.files[missing].path\n        );\n    }\n\n    Ok((picks, resolved_files.into_iter().flatten().collect()))\n}\n\n/// Record an undo point, apply `picks`, and commit the snapshot on success.\nfn apply_with_snapshot(\n    ctx: &mut but_ctx::Context,\n    request: &ResolutionRequest,\n    picks: &apply::PicksPerFile,\n    operation: OperationKind,\n    dry_run: DryRun,\n    perm: &mut RepoExclusive,\n) -> anyhow::Result<apply::AppliedResolution> {\n    let maybe_oplog_entry = but_oplog::UnmaterializedOplogSnapshot::from_details_with_perm(","sourceCodeStart":643,"sourceCodeEnd":679,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-api/src/resolve/mod.rs#L643-L679","documentation":"The AI full-resolve path requires full coverage: after processing every returned resolution, each conflicted file must have an entry. The first file with no resolution (its slot still None) fails validation with this message - a partial answer cannot be spliced into the 'fully resolved commit' promise, unlike the per-hunk API which permits subsets.","triggerScenarios":"The model resolves most files but silently skips one - typically a large file hitting output-token limits, or a file whose conflicts the model deemed trivial and omitted. Any missing file aborts before any write.","commonSituations":"Output truncation on big conflict sets (token cap reached mid-JSON, though malformed JSON usually fails earlier); models summarizing instead of enumerating; injection-based resolvers (resolve_commit_conflicts_with) that forget a file.","solutions":["The built-in retry may produce complete coverage; check whether the first attempt was truncated (token limit) and if so lower concurrency or raise max output tokens","Switch to a model with larger output capacity for commits with many conflicted files","Fall back to resolve_commit_conflict_hunks for the covered files and handle stragglers individually"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await api.resolveCommitConflictsAi(commitId);\n} catch (err) {\n  if (String(err).includes('no resolution for the conflicted file')) {\n    // likely token-limit truncation: retry once, then split work\n    await api.resolveCommitConflictsAi(commitId);\n  } else throw err;\n}","preventionTips":["Raise the model's max output tokens or split very conflicted commits before AI resolving","Prefer per-hunk resolve for large conflict sets - it tolerates partial coverage by design","When injecting resolvers, iterate request.files exactly so no file is skipped"],"tags":["ai-resolution","llm-validation","incomplete-response","resolve-api"],"backgroundTag":"llm-response-validation-failed","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}