Option A ("ask inline, session stays open") described a path where the
errand agent could ask questions without writing signal.json, which broke
the server's completion detection (checkAgentCompletionResult polls for
done|questions|error status). Remove the Option A/B distinction and make
signal.json with questions status the single mechanism for all user-input
requests, consistent with how other agents handle blocking questions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
export function buildErrandPrompt(description: string): string {
|
|
return `You are working on a small, focused change in an isolated worktree.
|
|
|
|
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, write .cw/output/signal.json with the questions format and end your session:
|
|
|
|
{ "status": "questions", "questions": [{ "id": "q1", "question": "What is the target file?" }] }
|
|
|
|
The session will end. The user will be shown your questions in the UI or via:
|
|
|
|
cw errand chat <id> "<their answer>"
|
|
|
|
Your session will then resume with their answers. 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": "<one-sentence summary of what you changed>" } }
|
|
|
|
If you cannot complete the change:
|
|
|
|
{ "status": "error", "error": "<explanation>" }
|
|
|
|
Do not create any other output files.`;
|
|
}
|