feat(claude-do): Merge-Session soll die Queue selbst beobachten statt fertige
## WO — verifiziert am 2026-09-02, nicht neu suchen - Merge-Phasen-Prompt: `src/ClaudeDo.Data/PromptFiles.cs`, Konstante `MergeHelperMergeDefault` (ab Z. 495). Der neue Warte-Abschnitt gehört zwischen "## Verify once — after the last merge" (Z. 526) und "## Handoff / end" (Z. 542) — also nach dem Verify, vor der Handoff-Entscheidung. - Brief-Template: `MergeHelperInitialDefault` (Z. 555) und `Mer ClaudeDo-Task: 1788adc4-c671-4942-ab78-1ef1812da494
This commit is contained in:
@@ -548,6 +548,30 @@ public static class PromptFiles
|
||||
|
||||
Allow at most ONE rerun per task in this session.
|
||||
|
||||
## Keep watching the queue
|
||||
|
||||
Do not assume the tasks you were handed are the only ones that matter. A prior Wait session
|
||||
can already have finished before every one of its tasks actually reached a terminal status,
|
||||
or new tasks can still be running when you start — merging only what happened to be ready the
|
||||
moment you looked in and then stopping is how work silently falls through the cracks.
|
||||
|
||||
Before you go to Handoff / end, call get_queue_state and check whether any task id from your
|
||||
brief still shows up in activeSlots or waitingTaskIds. If none do, your list is clear — go to
|
||||
Handoff / end now.
|
||||
|
||||
If some do, call wait_for_task_change with exactly those still-busy task ids,
|
||||
timeoutSeconds=900, treatWaitingForChildrenAsBusy=true. When it reports a change, go back to
|
||||
Phase 4 and merge/review whatever it now says is WaitingForReview, then repeat this check.
|
||||
|
||||
This is NOT a `sleep`-and-poll loop — never write your own retry/sleep loop around get_task or
|
||||
get_queue_state. wait_for_task_change already blocks server-side and reports progress so it
|
||||
survives your own client's idle-silence abort; that is the only waiting mechanism allowed here.
|
||||
|
||||
Hard cap: stop after at most THREE consecutive wait_for_task_change calls made this way (three
|
||||
900s timeouts ≈ 45 minutes total), even if tasks are still busy. When you stop — because the
|
||||
queue cleared or because you hit the cap — report whatever is still Queued/Running in the
|
||||
summary below and proceed to Handoff / end exactly as if this section didn't exist.
|
||||
|
||||
## Handoff / end
|
||||
|
||||
- If you started any reruns: call handoff_list_handler(taskId, <the rerun task ids>, nextPhase: "wait_final"), then stop your turn immediately — do not merge anything yet that you just restarted. Do NOT submit this run for review yet — the chain isn't finished.
|
||||
|
||||
Reference in New Issue
Block a user