fix: bound conflict repair runtime

This commit is contained in:
lezi-fun committed 2026-08-14 13:28:18 +08:00
1 parent 31756e84ba
commit 785cddedd9
4 files changed
+292 -137

No files matched your search

+15
View File
@@ -3,6 +3,7 @@ import test from "node:test";
import {
buildGooseAgentDockerArgs,
buildGooseAgentEnvironment,
buildIsolatedWorkspaceCommandDockerArgs,
buildWorkspacePermissionDockerArgs,
extractGooseFinalText
} from "../src/ai/gooseCli.js";
@@ -26,6 +27,20 @@ test("goose agent mounts the workflow binary read-only and keeps a visible insta
assert.equal(args.at(-1), "introduce this pull request");
});
test("isolated validation receives the repository but no model or GitHub credentials", () => {
const args = buildIsolatedWorkspaceCommandDockerArgs({
containerName: "ghbot-validation-test",
realWorkingDirectory: "/tmp/worktree",
command: "npm ci && npm test"
});
assert.ok(args.includes("type=bind,source=/tmp/worktree,target=/workspace"));
assert.ok(args.includes("HOME=/tmp/ghbot-validation-home"));
assert.ok(args.includes("CI=true"));
assert.equal(args.at(-1), "npm ci && npm test");
assert.equal(args.some((arg) => /OPENAI|GITHUB|GHBOT_GIT_TOKEN/.test(arg)), false);
});
test("goose agent can fall back to installing inside the container", () => {
const args = buildGooseAgentDockerArgs({
containerName: "ghbot-agent-test",