fix(tasks): unquarantine returns the card to a claimable pool - #2371
Conversation
unquarantine_task set status back to 'open' but kept claimed_by, and claim_task requires claimed_by IS NULL - so a claimed-then-quarantined card came back permanently unclaimable. Clear claimed_by/claimed_at on unquarantine, as reopen_task and release_task already do. Card: tsk-y6x6s4
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
📝 WalkthroughWalkthrough
ChangesUnquarantine claim reset
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summary (commit 2aabf13)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2aabf13)Status: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by step-3.7-flash · Input: 90.1K · Output: 9K · Cached: 233.3K |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tinyagentos/projects/task_store.py`:
- Around line 472-473: Update the status transition logic in update_task so
setting status to "open" clears claimed_by and claimed_at in the database and
includes both fields with None in the task.updated patch. Preserve existing
claim metadata for other status changes.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b2037764-9111-423d-a382-3f360693a224
📒 Files selected for processing (3)
changelog.d/tsk-y6x6s4-unquarantine-claimer.mdtests/projects/test_task_store.pytinyagentos/projects/task_store.py
|
nemotron-super review VERDICT: Pass Automated first-pass review by the nemotron-super lane. The lead still reviews before merge. |
Same class via the generic edit path: the owner/admin PATCH route passes status through update_task, so setting a claimed card back to 'open' left claimed_by set and the card unclaimable. Clear claim metadata and include it in the task.updated patch. Found by review on #2371.
Lead build of board card tsk-y6x6s4 (found during #2366 bot-thread adjudication, proven from source).
unquarantine_taskset the card back toopenbut never clearedclaimed_by/claimed_at.claim_taskrequiresclaimed_by IS NULL AND status = 'open', so a claimed-then-quarantined card returned from quarantine permanently unclaimable - by anyone, including the original claimer.reopen_taskandrelease_taskboth already clear the claimer for exactly this reason.Red proof at merge base (card demands red-first)
New test
test_unquarantine_returns_claimed_task_to_claimable_poolrun against the unfixed store at2eb1a8f6:With the fix: 30 passed across
test_task_store.py+test_strike_wiring.py. The test also proves the pool is real by having a second agent claim the card after un-quarantine (not just asserting NULL).Class sweep
All transitions back to
'open'intask_store.pynow clear the claimer (release_task,reopen_task,unquarantine_task).element_store.py's onlystatus = 'open'use is a COUNT, no claim mutation.quarantine_taskdeliberately keepsclaimed_by- the audit'sfrom_statusderivation depends on it and this fix preserves that.Summary by CodeRabbit
Bug Fixes
Tests
Second path (CodeRabbit finding, REAL, folded in da43b41)
The generic
update_taskedit path (owner/admin PATCH; agents are blocked fromstatusby the field whitelist) had the same gap - it builds its SET dynamically, which is why the SQL-literal class sweep missed it. Red proven pre-fix:Fixed by clearing claim metadata when a generic edit sets
status='open'(also emitted in thetask.updatedpatch). 27/27 green in the file post-fix.