
























@@ -1,7 +1,7 @@
11import { describe, expect, it, vi } from "vitest";
22import {
3-appendBootstrapFileToUserPromptPrefix,
43resolveAttemptWorkspaceBootstrapRouting,
4+shouldStripBootstrapFromEmbeddedContext,
55} from "./attempt-bootstrap-routing.js";
6677describe("runEmbeddedAttempt bootstrap routing", () => {
@@ -26,7 +26,7 @@ describe("runEmbeddedAttempt bootstrap routing", () => {
2626expect(isWorkspaceBootstrapPending).toHaveBeenCalledWith(canonicalWorkspace);
2727expect(isWorkspaceBootstrapPending).not.toHaveBeenCalledWith(sandboxWorkspace);
2828expect(routing.bootstrapMode).toBe("none");
29-expect(routing.userPromptPrefixText).toBeUndefined();
29+expect(routing.shouldStripBootstrapFromContext).toBe(true);
3030});
31313232it("falls back to limited bootstrap wording when a primary run cannot read files", async () => {
@@ -41,30 +41,15 @@ describe("runEmbeddedAttempt bootstrap routing", () => {
4141});
42424343expect(routing.bootstrapMode).toBe("limited");
44-expect(routing.userPromptPrefixText).toContain("Bootstrap is still pending");
45-expect(routing.userPromptPrefixText).toContain("cannot safely complete");
44+expect(routing.shouldStripBootstrapFromContext).toBe(true);
4645});
474648-it("appends BOOTSTRAP.md contents to the user prompt prefix for full bootstrap turns", () => {
49-const prompt = appendBootstrapFileToUserPromptPrefix({
50-prefixText: "[Bootstrap pending]",
51-bootstrapMode: "full",
52-contextFiles: [{ path: "/tmp/workspace/BOOTSTRAP.md", content: "Ask who I am." }],
53-});
54-55-expect(prompt).toContain("[Bootstrap pending]");
56-expect(prompt).toContain("[BEGIN BOOTSTRAP.md]");
57-expect(prompt).toContain("Ask who I am.");
58-expect(prompt).toContain("workspace/user instructions");
47+it("keeps BOOTSTRAP.md in Project Context for full bootstrap turns", () => {
48+expect(shouldStripBootstrapFromEmbeddedContext({ bootstrapMode: "full" })).toBe(false);
5949});
605061-it("does not append BOOTSTRAP.md contents for limited bootstrap turns", () => {
62-const prompt = appendBootstrapFileToUserPromptPrefix({
63-prefixText: "[Bootstrap pending]",
64-bootstrapMode: "limited",
65-contextFiles: [{ path: "/tmp/workspace/BOOTSTRAP.md", content: "Ask who I am." }],
66-});
67-68-expect(prompt).toBe("[Bootstrap pending]");
51+it("strips BOOTSTRAP.md from Project Context outside full bootstrap turns", () => {
52+expect(shouldStripBootstrapFromEmbeddedContext({ bootstrapMode: "limited" })).toBe(true);
53+expect(shouldStripBootstrapFromEmbeddedContext({ bootstrapMode: "none" })).toBe(true);
6954});
7055});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。