Skip to content

fix: td reject resets issues to open instead of in_progress#47

Merged
marcus merged 1 commit intomarcus:mainfrom
ricktraveler:claude/td-bug
Feb 26, 2026
Merged

fix: td reject resets issues to open instead of in_progress#47
marcus merged 1 commit intomarcus:mainfrom
ricktraveler:claude/td-bug

Conversation

@ricktraveler
Copy link
Contributor

Summary

  • td reject previously set issues to in_progress, but with no owning agent. Since td next only shows open issues, rejected work silently fell out of the queue.
  • Now td reject resets status to open and clears implementer_session, so rejected issues re-enter the queue and get picked up by td next.
  • Updated "needs rework" detection to find rejected issues in both open and in_progress states.

Fixes #45

Test plan

  • Existing tests updated to verify reject → open transition
  • Workflow state machine tests confirm in_review → open is valid
  • Integration tests verify reject behavior

🤖 Generated with Claude Code

Previously, td reject set issues to in_progress, but since no agent
owned them afterward, td next (which only shows open issues) would
never surface them again, silently dropping rejected work from the
queue.

Now td reject resets status to open and clears implementer_session,
so rejected issues re-enter the queue and get picked up by td next.
The "needs rework" detection is updated to find rejected issues in
both open and in_progress states.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@marcus
Copy link
Owner

marcus commented Feb 23, 2026

Hey @ricktraveler! Starling here (AI assistant on the project). 👋

Clean resubmit — thanks for the discipline on keeping the commit history tidy.

Quick review pass on the approach:

  • ** (not )** is semantically correct. After rejection the owning session is gone; in_progress falsely implies an agent still has it. Resetting to open restores the invariant and makes td next pick it back up. ✓
  • Clearing implementer_session on reject is the right complement — no dangling session reference for a window that no longer exists. ✓
  • Rework detection covering both states is a good defensive touch; makes the query resilient if any historical data has orphaned in_progress issues from before this fix. ✓
  • Test coverage looks solid (state machine + integration). ✓

Flagging @marcus for final merge review — this touches core workflow state transitions so worth a human sign-off, but the logic looks correct to me. ✦

@marcus marcus merged commit e9813af into marcus:main Feb 26, 2026
@marcus
Copy link
Owner

marcus commented Feb 26, 2026

Thanks @ricktraveler — good catch on the reject workflow. Resetting to open so td next picks it up again makes much more sense. Merged! 🪶

Copy link
Owner

@marcus marcus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Reviewed the diff and ran the full test suite — all passing. ✅

The change is correct. Resetting to open instead of in_progress on reject makes much more sense semantically — it allows td next to re-queue the work for any available implementer session, rather than leaving it stranded in in_progress without an active implementer.

A few things I particularly liked:

  • Clearing ImplementerSession on reject is a great catch — without this the stale session reference would be misleading and could cause subtle issues downstream.
  • GetRejectedInProgressIssueIDs updated to status IN ('open', 'in_progress') — correctly handles both the freshly-rejected (open) and already-re-picked-up (in_progress) cases. The new issue5 test case for that scenario is exactly right.
  • TransitionName updated — now in_review → open is the canonical "reject" transition, which keeps the action log semantics clean.
  • Test coverage is thorough and the test names/comments clearly explain the intent.

One minor observation (not a blocker): the comment on GetRejectedInProgressIssueIDs still has "InProgress" in the function name, but that's a pre-existing naming artifact and renaming it would be a broader refactor. Totally fine to leave as-is.

Great contribution — welcome to the project! 🎉

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.

td reject leaves issues orphaned in in_progress — never re-enters agent work queue

2 participants