From 6ae83dcd8ac3e5ae6dc3400131e94ae3ae1a055e Mon Sep 17 00:00:00 2001 From: Zbigniew Sobiecki Date: Sat, 14 Mar 2026 08:14:55 +0000 Subject: [PATCH] fix(backlog-manager): add explicit rule to invoke commands as tool calls, not describe them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gemini Flash (and similar models) sometimes output bash commands inside markdown code blocks instead of actually invoking them as tool calls, then stop with reason:stop — causing silent no-ops (card never moved). Adds an engine-agnostic CRITICAL rule to the Rules section of the backlog-manager prompt instructing the model to always invoke tool calls rather than narrate them as text. Also adds a regression test asserting the rule appears in the rendered system prompt. Co-Authored-By: Claude Sonnet 4.6 --- src/agents/prompts/templates/backlog-manager.eta | 1 + tests/unit/agents/prompts.test.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/agents/prompts/templates/backlog-manager.eta b/src/agents/prompts/templates/backlog-manager.eta index 56cd775c..3454cefa 100644 --- a/src/agents/prompts/templates/backlog-manager.eta +++ b/src/agents/prompts/templates/backlog-manager.eta @@ -102,3 +102,4 @@ Manual intervention may be needed to unblock the backlog. - ALWAYS post a comment BEFORE moving the <%= it.workItemNoun || 'card' %> — comment first, then move to TODO - BE CONSERVATIVE with dependency detection - when unsure, treat as blocked - LOOK FOR dependency keywords: "blocked by", "depends on", "waiting for", "after", "requires" +- EXECUTE COMMANDS — DO NOT JUST DESCRIBE THEM: When you decide to post a comment or move a card, you MUST actually invoke the command as a tool call. Writing a command inside a code block without invoking it does NOT execute it — text output has no effect on the system. If you find yourself writing out a command without calling it, stop and call it instead. diff --git a/tests/unit/agents/prompts.test.ts b/tests/unit/agents/prompts.test.ts index d3d5d5de..656550e7 100644 --- a/tests/unit/agents/prompts.test.ts +++ b/tests/unit/agents/prompts.test.ts @@ -189,6 +189,13 @@ describe('system prompts content', () => { expect(prompt).toContain('card'); }); + it('backlog-manager prompt warns against describing commands instead of invoking them', () => { + const prompt = getSystemPrompt('backlog-manager'); + expect(prompt).toContain('EXECUTE COMMANDS'); + expect(prompt).toContain('DO NOT JUST DESCRIBE THEM'); + expect(prompt).toContain('text output has no effect on the system'); + }); + it('backlog-manager prompt posts comment before moving card', () => { const prompt = getSystemPrompt('backlog-manager'); const commentStepIdx = prompt.indexOf('5. **Post a comment**');