fix: errand output race condition + require commit before signal

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.
This commit is contained in:
Lukas May
2026-03-06 22:23:50 +01:00
parent e199188670
commit 3ceb991200
2 changed files with 9 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ export function buildErrandPrompt(description: string): string {
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>" } }
@@ -25,6 +26,7 @@ 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>" } }