Skip to content

fix: unblock_task returns to todo and clears stale claims#25

Merged
danielkov merged 1 commit intomainfrom
fix/unblock-task-status
Feb 22, 2026
Merged

fix: unblock_task returns to todo and clears stale claims#25
danielkov merged 1 commit intomainfrom
fix/unblock-task-status

Conversation

@danielkov
Copy link
Copy Markdown
Collaborator

Summary

  • unblock_task now always transitions to todo instead of checking started_at to decide between in_progress/todo
  • Clears stale claim fields (claim_owner, claim_claimed_at, claim_lease_expires_at) on unblock so the task.next SQLite trigger fires correctly
  • Fixes a bug where unblocked tasks were invisible to worker daemons because no task.next event was emitted

Root cause

unblock_task checked started_at.is_some() to decide the target status. Since agents set started_at when they begin work, unblocking always returned to in_progress. Additionally, stale claim fields were preserved, so even manually cycling through draft → todo couldn't trigger task.next — the trigger's claim guard suppressed it:

AND (NEW.claim_owner IS NULL OR NEW.claim_lease_expires_at < strftime(...))

✻ Clauded...

unblock_task checked started_at to decide status, always returning to
in_progress for tasks that had been worked on. It also preserved stale
claim fields, which suppressed the task.next trigger's claim guard.

Now always returns to todo and clears claim_owner/lease so the task.next
event fires and workers can pick up the task.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danielkov danielkov merged commit 2c06190 into main Feb 22, 2026
3 checks passed
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