finished better review prep (better execution capture of git)
This commit is contained in:
@@ -19,10 +19,7 @@ import {
|
||||
buildConflictResolutionPrompt,
|
||||
MAX_DIFF_BYTES,
|
||||
} from "./prompts";
|
||||
import {
|
||||
compileIgnorePatterns,
|
||||
type DiffOptions,
|
||||
} from "./diff";
|
||||
import { compileIgnorePatterns } from "./diff";
|
||||
import { extractReflection } from "./reflection";
|
||||
import {
|
||||
extractReview,
|
||||
@@ -49,6 +46,7 @@ import {
|
||||
ensureDir,
|
||||
captureGitCommits,
|
||||
captureGitHead,
|
||||
canComputeRange,
|
||||
getCommitRangeDiff,
|
||||
hasUncommittedChanges,
|
||||
getGitStatusPorcelain,
|
||||
@@ -918,6 +916,15 @@ async function executeTask(
|
||||
);
|
||||
break;
|
||||
}
|
||||
// Cheap guard mirroring canCompareToBase: if the captured base ref no
|
||||
// longer resolves (stale/broken worktree ref), warn explicitly and
|
||||
// never treat the task as review-verified.
|
||||
if (!canComputeRange(worktreeDir, baseRef)) {
|
||||
sendChatMessage?.(
|
||||
`~ review for ${task.id} · ${task.title} — diff could not be computed (base ref ${baseRef} no longer resolves)`,
|
||||
);
|
||||
break;
|
||||
}
|
||||
const rangeDiff = getCommitRangeDiff(worktreeDir, baseRef);
|
||||
if (rangeDiff.kind === "error") {
|
||||
sendChatMessage?.(
|
||||
|
||||
Reference in New Issue
Block a user