Skip to content

Commit 48346e1

Browse files
authored
fix: require structured blocking questions (#3762)
1 parent dec9229 commit 48346e1

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

packages/workspace-server/src/services/agent/agent.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,29 @@ describe("AgentService", () => {
845845
expect(prompt).toContain("If the user names a folder or path");
846846
});
847847
});
848+
849+
describe("system prompt questions", () => {
850+
it("requires blocking questions to use a structured user-input tool", () => {
851+
const prompt = (
852+
service as unknown as {
853+
buildSystemPrompt: (
854+
credentials: { apiHost: string; projectId: number },
855+
taskId: string,
856+
) => { append: string };
857+
}
858+
).buildSystemPrompt(
859+
{ apiHost: "https://app.posthog.com", projectId: 1 },
860+
"task-1",
861+
).append;
862+
863+
expect(prompt).toContain(
864+
"use the structured user-input tool available in your current mode",
865+
);
866+
expect(prompt).toContain(
867+
"plain-text questions mark the task as finished",
868+
);
869+
});
870+
});
848871
});
849872

850873
describe("buildAutoApproveOutcome", () => {

packages/workspace-server/src/services/agent/agent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,9 @@ When creating pull requests, add the following footer at the end of the PR descr
652652
653653
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.
654654
655+
## Questions
656+
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.
657+
655658
## Shell efficiency
656659
Optimize for the fewest shell round trips.
657660
- Batch related commands into one Bash invocation using \`&&\` (e.g. \`npm run typecheck && npm run lint && npm test\`).

0 commit comments

Comments
 (0)