fix: keep conflict editing focused

This commit is contained in:
lezi-fun committed 2026-08-14 13:48:44 +08:00
1 parent 135bc060e2
commit 508f6423c4
2 files changed
+38 -8

No files matched your search

+18
View File
@@ -2,6 +2,7 @@ import assert from "node:assert/strict";
import test from "node:test";
import {
buildConflictDiffCheckArgs,
buildConflictPrompt,
buildValidationRepairPrompt,
buildConflictPushArgs,
buildConflictReviewDiffArgs,
@@ -83,6 +84,10 @@ test("conflict failures are actionable without exposing raw command output", ()
describeConflictResolutionFailure(new Error("git diff --check goose correction timed out")),
/4-minute limit/
);
assert.match(
describeConflictResolutionFailure(new Error("initial goose conflict-editing pass timed out")),
/initial conflict-editing pass.*4-minute limit/i
);
assert.match(
describeConflictResolutionFailure(new Error("rejected: stale info")),
/Run \/conflict again/
@@ -93,6 +98,19 @@ test("conflict failures are actionable without exposing raw command output", ()
);
});
test("initial conflict prompt leaves full validation to the isolated host pass", () => {
const validationCommand = "npm ci && npm test";
const prompt = buildConflictPrompt(
{ pullNumber: 15, baseBranch: "Lite", headBranch: "fix/conflicts" },
["server.js"],
validationCommand
);
assert.match(prompt, /separate credential-free container/);
assert.match(prompt, /Do not install dependencies or run that full validation command yourself/);
assert.match(prompt, /npm ci && npm test/);
assert.doesNotMatch(prompt, /Run this exact trusted repository validation command/);
});
test("diff-check whitespace diagnostics are repaired without another agent run", () => {
const diagnostics = parseDiffCheckWhitespaceDiagnostics([
"src/app.js:2: trailing whitespace.",