fix: populate memoriesSection in execute-task prompt and fix stale dist
buildExecuteTaskPrompt was not passing memoriesSection to loadPrompt, causing headless auto to fail with a template variable error. Also updated plan-slice-prompt.test.ts to supply the four template variables (memoriesSection, runtimeContext, phaseAnchorSection, gatesToClose) that were missing from the test fixture. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a30a7692e3
commit
7289933909
2 changed files with 20 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
import { loadFile, parseContinue, parseSummary, loadActiveOverrides, formatOverridesSection, parseTaskPlanFile } from "./files.js";
|
||||
import { getActiveMemoriesRanked, formatMemoriesForPrompt } from "./memory-store.js";
|
||||
import type { Override, UatType } from "./files.js";
|
||||
import { hasVerdict, getUatType } from "./verdict-parser.js";
|
||||
import { loadPrompt, inlineTemplate } from "./prompt-loader.js";
|
||||
|
|
@ -1872,7 +1873,18 @@ export async function buildExecuteTaskPrompt(
|
|||
{ pending: new Set(etPending.map((g) => g.gate_id)), allowOmit: true },
|
||||
);
|
||||
|
||||
const memoriesSection = (() => {
|
||||
try {
|
||||
const memories = getActiveMemoriesRanked(10);
|
||||
if (memories.length === 0) return "## Project Memories\n(none yet)";
|
||||
return `## Project Memories\n${formatMemoriesForPrompt(memories)}`;
|
||||
} catch {
|
||||
return "## Project Memories\n(unavailable)";
|
||||
}
|
||||
})();
|
||||
|
||||
return loadPrompt("execute-task", {
|
||||
memoriesSection,
|
||||
overridesSection,
|
||||
runtimeContext,
|
||||
phaseAnchorSection,
|
||||
|
|
|
|||
|
|
@ -111,6 +111,10 @@ test("skillActivation default leaves no unresolved placeholder", () => {
|
|||
inlinedTemplates: "Template",
|
||||
verificationBudget: "~10K chars",
|
||||
overridesSection: "",
|
||||
memoriesSection: "## Project Memories\n(none yet)",
|
||||
runtimeContext: "",
|
||||
phaseAnchorSection: "",
|
||||
gatesToClose: "",
|
||||
});
|
||||
|
||||
assert.ok(!result.includes("{{skillActivation}}"));
|
||||
|
|
@ -136,6 +140,10 @@ test("custom skillActivation is substituted into execute-task", () => {
|
|||
inlinedTemplates: "Template",
|
||||
verificationBudget: "~10K chars",
|
||||
overridesSection: "",
|
||||
memoriesSection: "## Project Memories\n(none yet)",
|
||||
runtimeContext: "",
|
||||
phaseAnchorSection: "",
|
||||
gatesToClose: "",
|
||||
skillActivation: "Load React and accessibility skills first.",
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue