Merge two useEffects in AgentOutputViewer into one to fix race where agentId reset clears messages after data effect sets them on remount. Add "commit before signaling" instruction to errand prompts so Changes tab shows diff after completion.
40 lines
1.5 KiB
TypeScript
40 lines
1.5 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.
|
|
Before signaling completion, commit all your changes with a clear commit message describing what you did. Do not leave uncommitted work.
|
|
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.`;
|
|
}
|
|
|
|
export function buildErrandRevisionPrompt(description: string, feedback: string): string {
|
|
return `You are revising a previous change in an isolated worktree. The worktree already contains your prior work.
|
|
|
|
Original description: ${description}
|
|
|
|
The user reviewed your changes and requested revisions:
|
|
|
|
${feedback}
|
|
|
|
Make only the changes needed to address the feedback. Do not undo prior work unless the feedback specifically asks for it.
|
|
Before signaling completion, commit all your changes with a clear commit message describing what you did. Do not leave uncommitted work.
|
|
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.`;
|
|
}
|