fix: allow reassigning already-assigned tasks#158
Merged
ChenNima merged 1 commit intoChorus-AIDLC:mainfrom Apr 14, 2026
Merged
Conversation
claimTask() only accepted tasks with status "open", so reassigning a task that was already assigned to someone always failed with AlreadyClaimedError. The UI allowed it (checks for open || assigned) but the service layer rejected it. Widen the Prisma where filter to accept both "open" and "assigned" status, matching the UI-side validation. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
ChenNima
approved these changes
Apr 14, 2026
Contributor
ChenNima
left a comment
There was a problem hiding this comment.
LGTM. Real bug — UI and MCP callers allow assigned status but service layer only matched open. Fix is correct and minimal. Tests look good.
Minor nits (non-blocking):
task.service.ts:589comment still says "only succeeds if status is open" — could update to include "assigned"developer.ts:20MCP tool description "(open -> assigned)" could mention reassign
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12 (reassign part — button layout is a separate CSS issue)
What's wrong
claimTask()intask.service.tsonly matches tasks withstatus: "open":But the UI-side check in
actions.tsallows bothopenandassigned:So when you try to reassign a task that's already assigned to someone, the UI says "go ahead" but the service layer says "nope" — Prisma can't find a matching row and throws P2025, which becomes
AlreadyClaimedError.Fix
Now reassigning works. If the task is in any other status (in_progress, to_verify, done, closed), it still correctly rejects.
Tests