diff --git a/packages/workspace-server/src/services/agent/agent.test.ts b/packages/workspace-server/src/services/agent/agent.test.ts index 293ac3854e..14204e4065 100644 --- a/packages/workspace-server/src/services/agent/agent.test.ts +++ b/packages/workspace-server/src/services/agent/agent.test.ts @@ -845,6 +845,29 @@ describe("AgentService", () => { expect(prompt).toContain("If the user names a folder or path"); }); }); + + describe("system prompt questions", () => { + it("requires blocking questions to use a structured user-input tool", () => { + const prompt = ( + service as unknown as { + buildSystemPrompt: ( + credentials: { apiHost: string; projectId: number }, + taskId: string, + ) => { append: string }; + } + ).buildSystemPrompt( + { apiHost: "https://app.posthog.com", projectId: 1 }, + "task-1", + ).append; + + expect(prompt).toContain( + "use the structured user-input tool available in your current mode", + ); + expect(prompt).toContain( + "plain-text questions mark the task as finished", + ); + }); + }); }); describe("buildAutoApproveOutcome", () => { diff --git a/packages/workspace-server/src/services/agent/agent.ts b/packages/workspace-server/src/services/agent/agent.ts index a352357e3b..9fa5c7db8a 100644 --- a/packages/workspace-server/src/services/agent/agent.ts +++ b/packages/workspace-server/src/services/agent/agent.ts @@ -652,6 +652,9 @@ When creating pull requests, add the following footer at the end of the PR descr When you mention a pull request in any reply or summary, always hyperlink it to its full URL (e.g. a Markdown link like [#123](https://github.com/org/repo/pull/123)) rather than plain text, so readers can open it directly. +## Questions +When you need an answer from the user before you can continue, use the structured user-input tool available in your current mode. Never end a turn with a blocking question in a normal assistant message because plain-text questions mark the task as finished instead of waiting for the user's response. + ## Shell efficiency Optimize for the fewest shell round trips. - Batch related commands into one Bash invocation using \`&&\` (e.g. \`npm run typecheck && npm run lint && npm test\`).