From 7cd248446198e2ac634d9f9bac2e7e5470636eb8 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Thu, 15 Jan 2026 10:44:45 -0500 Subject: [PATCH] fix(opencode): skip Plan Submission prompt for title generation The Plan Submission system prompt was being injected into ALL requests, including title generation. This caused the title generator to see the wrong system prompt and attempt to call submit_plan instead of generating a title. This fix detects title generation requests by checking for "title generator" or "generate a title" in the existing system prompt and skips injecting the Plan Submission instructions for those requests. Co-Authored-By: Claude Opus 4.5 --- apps/opencode-plugin/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/opencode-plugin/index.ts b/apps/opencode-plugin/index.ts index 51c5a36..a920cab 100644 --- a/apps/opencode-plugin/index.ts +++ b/apps/opencode-plugin/index.ts @@ -34,6 +34,14 @@ const reviewHtmlContent = reviewHtml as unknown as string; export const PlannotatorPlugin: Plugin = async (ctx) => { return { "experimental.chat.system.transform": async (_input, output) => { + // Skip adding Plan Submission prompt for title generation requests + // Title generation has a specific system prompt containing "title generator" + // and typically has no tools + const existingSystem = output.system.join("\n").toLowerCase(); + if (existingSystem.includes("title generator") || existingSystem.includes("generate a title")) { + return; // Skip - this is a title generation request + } + output.system.push(` ## Plan Submission -- knotmirror 0.0.1