fix: correct $ARGUMENTS token in plugin-compaction-init template

OpenCode's argument token is $ARGUMENTS, not $ARGUMENTS$. With the
extra dollar sign, OpenCode did not substitute the token, so the LLM
ended up writing the literal $ARGUMENTS$ line into the memory file
when no arguments were passed.
This commit is contained in:
2026-08-11 12:55:37 +05:30
parent 387457ea94
commit 9f549acfde
3 changed files with 9 additions and 5 deletions
+3 -3
View File
@@ -179,10 +179,10 @@ describe("buildInitCommandTemplate", () => {
expect(template).toContain("## Discard\n");
});
test("leaves $ARGUMENTS$ unsubstituted for OpenCode to fill in", () => {
test("leaves $ARGUMENTS unsubstituted for OpenCode to fill in", () => {
const template = buildInitCommandTemplate(".opencode/compaction.md");
expect(template.trimEnd().endsWith("$ARGUMENTS$")).toBe(true);
expect(template.trimEnd().endsWith("$ARGUMENTS")).toBe(true);
});
});
@@ -210,7 +210,7 @@ describe("CompactionPromptPlugin config hook", () => {
"## Discard",
);
expect(cfg.command?.["plugin-compaction-init"].template).toContain(
"$ARGUMENTS$",
"$ARGUMENTS",
);
expect(context.logs).toHaveLength(0);
});