diff --git a/apps/server/agent/file-io.test.ts b/apps/server/agent/file-io.test.ts index ae0fb9a..8c567f0 100644 --- a/apps/server/agent/file-io.test.ts +++ b/apps/server/agent/file-io.test.ts @@ -481,4 +481,10 @@ describe('buildErrandPrompt', () => { const result = buildErrandPrompt('some change'); expect(result).toContain('"status": "error"'); }); + + it('includes instructions for asking questions', () => { + const result = buildErrandPrompt('some change'); + expect(result).toMatch(/ask|question/i); + expect(result).toMatch(/chat|message|reply/i); + }); }); diff --git a/apps/server/agent/prompts/errand.ts b/apps/server/agent/prompts/errand.ts index e94b950..cb9feaf 100644 --- a/apps/server/agent/prompts/errand.ts +++ b/apps/server/agent/prompts/errand.ts @@ -4,6 +4,17 @@ export function buildErrandPrompt(description: string): string { Description: ${description} Work interactively with the user. Make only the changes needed to fulfill the description. + +## Asking questions + +If you need clarification before or during the change, ask the user directly in your response and wait. The user can reply via the UI chat input on the Errands page or by running: + + cw errand chat "" + +Their reply will be delivered as the next message in this session. Be explicit about what you need — don't make assumptions when the task is ambiguous. + +## Finishing + When you are done, write .cw/output/signal.json: { "status": "done", "result": { "message": "" } }