From 15369b8366578d0fee35b15ecf72fdd470879911 Mon Sep 17 00:00:00 2001 From: willytop8 Date: Sat, 11 Jul 2026 23:30:05 -0500 Subject: [PATCH] fix: improve completion marker compliance --- CHANGELOG.md | 2 ++ src/goal-plugin.js | 9 +++++++-- test/goal-plugin.test.js | 11 +++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65b247a..e65eb10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Clarify the textual completion protocol so models keep evidence and completion on consecutive plain-text lines instead of wrapping markers in Markdown or separating them with blank lines. + ## 0.6.2 — 2026-07-11 - Keep paused, blocked, and crash-recovered goals inert in model turns with a stopped-goal system guard, and enforce status/history/list/pause/clear control turns as read-only through the host's tool-execution hook so routed command text cannot mutate or resurrect work. diff --git a/src/goal-plugin.js b/src/goal-plugin.js index b2a7396..ae127d3 100644 --- a/src/goal-plugin.js +++ b/src/goal-plugin.js @@ -1756,11 +1756,16 @@ function buildContinueMessage( ) } else { lines.push( - "Continue with the next concrete step; inspect current state and repair failures.", + "Continue the next concrete step; inspect and repair failures.", ) } - lines.push("Complete only after verification: `[goal:evidence] …` then `[goal:complete]`. If only user input can unblock work, state why then `[goal:blocked]`.") + lines.push( + "Completion format—consecutive plain lines; no Markdown/backticks/blank line:", + "[goal:evidence] ", + "[goal:complete]", + "Need user input? State why before [goal:blocked].", + ) const limitWarning = buildLimitWarning(goal) if (limitWarning) lines.push(limitWarning.trim()) diff --git a/test/goal-plugin.test.js b/test/goal-plugin.test.js index 911061b..9f65ab8 100644 --- a/test/goal-plugin.test.js +++ b/test/goal-plugin.test.js @@ -409,8 +409,15 @@ test("continue message includes budget context and completion audit", () => { }) assert.match(messageText, //) assert.match(messageText, /tokens_remaining: 75/) - assert.match(messageText, /Complete only after verification/) - assert.match(messageText, /\[goal:evidence\].*\[goal:complete\]/) + assert.match(messageText, /Completion format/) + assert.match( + messageText, + /consecutive plain lines; no Markdown\/backticks\/blank line/, + ) + assert.match( + messageText, + /\[goal:evidence\] \n\[goal:complete\]/, + ) assert.match(messageText, /Limits are near:/) })