Skip to content

Commit f018af7

Browse files
jpicklykclaude
andcommitted
fix: broaden retrospective nudge to cover all terminal transition paths
The retrospective nudge previously only fired after complete_tree, missing single-item runs that reach terminal via advance_item. Updated the nudge condition to trigger on any terminal transition during an /implement run, with single-item, multi-item, and fallback detection rules. Also: minor AdvanceItemTool optimization — derive existingKeys from notesByKey instead of a separate .map() pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c65392d commit f018af7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

claude-plugins/task-orchestrator/output-styles/workflow-orchestrator.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ During any implementation run (triggered by `/implement` or `post-plan-workflow`
129129

130130
## Retrospective Nudge
131131

132-
After `complete_tree` completes, or when 3+ items transition to terminal during a session, append a one-line suggestion:
132+
When **any** item that was part of an `/implement` run reaches terminal — whether via `advance_item`, `complete_tree`, or auto-cascade — check if the run is complete:
133+
134+
- **Single-item run:** The item reaching terminal = run complete.
135+
- **Multi-item run (manifest exists):** All items in `scope.preExistingItems` are terminal = run complete.
136+
- **No manifest fallback:** 3+ items transition to terminal during a session = likely run complete.
137+
138+
When the run is complete, append a one-line suggestion:
133139

134140
```
135141
↳ Implementation run complete. Consider running `/session-retrospective` to capture learnings.

current/src/main/kotlin/io/github/jpicklyk/mcptask/current/application/tools/workflow/AdvanceItemTool.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ Trigger-based role transitions for WorkItems with validation, cascade detection,
387387
is Result.Success -> notesResult.data
388388
is Result.Error -> emptyList()
389389
}
390-
val existingKeys = existingNotes.map { it.key }.toSet()
391390
val notesByKey = existingNotes.associateBy { it.key }
391+
val existingKeys = notesByKey.keys
392392

393393
// Build expectedNotes: schema entries matching the new role (tool-specific, includes "exists")
394394
val forNewRole = schema.filter { it.role == newRoleStr }

0 commit comments

Comments
 (0)