Skip to content

fix: return actionable error when attemptCompletion blocked by incomplete todos#697

Merged
FL4TLiN3 merged 3 commits intomainfrom
fix/attempt-completion-error-message
Mar 4, 2026
Merged

fix: return actionable error when attemptCompletion blocked by incomplete todos#697
FL4TLiN3 merged 3 commits intomainfrom
fix/attempt-completion-error-message

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Mar 4, 2026

Summary

  • When attemptCompletion is called with incomplete todos, it now returns isError: true with a human-readable message instead of a raw JSON success result
  • The error message lists remaining todos with their IDs and provides explicit instructions to use the todo tool to mark them as completed
  • Fixes the loop where AI repeatedly calls attemptCompletion without resolving pending todos

Test plan

  • Unit tests updated and passing
  • Typecheck passing

🤖 Generated with Claude Code

FL4TLiN3 and others added 2 commits March 4, 2026 15:56
…d by incomplete todos

Previously, attemptCompletion returned a success result with raw JSON data
when incomplete todos existed, giving the AI no guidance on what to do next.
This caused a loop where the AI repeatedly called attemptCompletion without
resolving the pending todos.

Now returns isError: true with a clear message listing remaining todos and
explicit instructions to use the todo tool to mark them as completed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 force-pushed the fix/attempt-completion-error-message branch from d97f729 to 225ec13 Compare March 4, 2026 15:56
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 merged commit e3480f7 into main Mar 4, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 mentioned this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant