Fix task completion detection to require explicit completion signal#268
Fix task completion detection to require explicit completion signal#268
Conversation
Tasks were being marked complete when agents exited with code 0, even if no actual work was done. This caused issues when agents asked clarification questions and then exited cleanly without receiving answers. Now only the explicit <promise>COMPLETE</promise> signal marks a task as complete. Exit code 0 alone is not sufficient, as it just means the process ended normally - not that the task was actually finished. Fixes #259 https://claude.ai/code/session_019UgvbDYXAw19kEShx3c5PC
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
WalkthroughVersion bumped to 0.7.0. Task completion detection was changed to require an explicit COMPLETE tag in agent stdout; completion is no longer inferred from the agent's exit status. New tests and a template export were added. Changes
Sequence Diagram(s)sequenceDiagram
participant Agent as Agent
participant Engine as Engine
participant Tracker as Tracker
participant VCS as VCS
Agent->>Engine: stdout (may include <promise>COMPLETE</promise>)
alt stdout contains explicit <promise>COMPLETE</promise>
Engine->>Tracker: mark task COMPLETE (update metadata)
Engine->>VCS: commit metadata + outputs
else no explicit completion signal
Engine->>Tracker: mark task INCOMPLETE (record status/notes)
Engine->>VCS: commit metadata-only (if any)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (20.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #268 +/- ##
==========================================
- Coverage 43.69% 43.68% -0.01%
==========================================
Files 94 94
Lines 29009 29012 +3
==========================================
- Hits 12676 12675 -1
- Misses 16333 16337 +4
🚀 New features to boost your workflow:
|
- Add completion-detection.test.ts with 24 tests covering: - PROMISE_COMPLETE_PATTERN matching behavior - Task completion logic (only explicit signal marks complete) - Edge cases from issue #259 (metadata-only updates, looping) - Add tests for BEADS_RUST_TEMPLATE in template engine tests: - getBuiltinTemplate returns correct template - getTemplateTypeFromPlugin maps beads-rust correctly - getTemplateFilename returns beads-rust.hbs - loadTemplate loads beads-rust tracker template https://claude.ai/code/session_019UgvbDYXAw19kEShx3c5PC
…zrJBc Fix task completion detection to require explicit completion signal
Summary
Fixed a bug where tasks were incorrectly marked as completed based solely on exit code 0, rather than requiring an explicit completion signal from the agent.
Changes
ExecutionEngineto only recognize the explicit<promise>COMPLETE</promise>signal as indicating task completionagentResult.status === 'completed'as a completion indicatorDetails
Previously, the engine would consider a task complete if either:
<promise>COMPLETE</promise>, ORThis caused false positives where agents that exited cleanly (status 0) but were still waiting for user input or had encountered a blocker would be incorrectly marked as complete.
Now, only the explicit
<promise>COMPLETE</promise>signal is recognized as a valid completion indicator, ensuring tasks are only marked complete when the agent explicitly indicates completion.Fixes #259
https://claude.ai/code/session_019UgvbDYXAw19kEShx3c5PC
Summary by CodeRabbit
Chores
Bug Fixes
Tests
New Features