From 72ac6cf35788d60e1a6f3dfec67ff633eb08bcd5 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:00:01 +0800 Subject: [PATCH] nudge when plan.md exists but no goal line matches, instead of going silently inert Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com> --- src/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 27be161..9e273d9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -144,7 +144,18 @@ export default function piGoalsExtension(pi: ExtensionAPI): void { } const plan = readPlan(ctx); const goals = scanGoals(plan); - if (goals.length === 0) return; + if (goals.length === 0) { + // Non-empty plan but no recognizable goal line: the harness would go silently inert (no + // widget, no injection, no reminders). Say so once instead -- cooperative but confused. + if (!plan.trim()) return; + return { + message: { + customType: PLAN_CONTEXT, + content: `${PLAN_REL} exists but has no goal line pi-goals recognizes. A goal is a checkbox list line starting "goal:", e.g. "1. [ ] goal: " ([ ] open, [/] active, [x] done, [-] cancelled). Reformat if it's meant to be the plan.`, + display: false, + }, + }; + } // The plan file itself IS the injection: no parsing, no summarizing, the model sees the // literal file it edits. Byte-identical when unchanged, so the prefix cache holds. let body = `Current plan (${PLAN_REL}; keep it updated with your edit tool):\n\n${plan}`;