Skip to content

fix(tasks): unquarantine returns the card to a claimable pool - #2371

Merged
jaylfc merged 2 commits into
devfrom
exec/tsk-y6x6s4
Aug 12, 2026
Merged

fix(tasks): unquarantine returns the card to a claimable pool#2371
jaylfc merged 2 commits into
devfrom
exec/tsk-y6x6s4

Conversation

@jaylfc

@jaylfc jaylfc commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Lead build of board card tsk-y6x6s4 (found during #2366 bot-thread adjudication, proven from source).

unquarantine_task set the card back to open but never cleared claimed_by/claimed_at. claim_task requires claimed_by IS NULL AND status = 'open', so a claimed-then-quarantined card returned from quarantine permanently unclaimable - by anyone, including the original claimer. reopen_task and release_task both 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_pool run against the unfixed store at 2eb1a8f6:

>       assert back["claimed_by"] is None
E       AssertionError: assert 'agent-1' is None

tests/projects/test_task_store.py:164: AssertionError
FAILED tests/projects/test_task_store.py::test_unquarantine_returns_claimed_task_to_claimable_pool
1 failed in 0.38s

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' in task_store.py now clear the claimer (release_task, reopen_task, unquarantine_task). element_store.py's only status = 'open' use is a COUNT, no claim mutation. quarantine_task deliberately keeps claimed_by - the audit's from_status derivation depends on it and this fix preserves that.

Summary by CodeRabbit

  • Bug Fixes

    • Un-quarantining a claimed task now clears its claimant information.
    • The task returns to the open, claimable pool and can be claimed by another agent.
    • Behavior now aligns with reopening and releasing tasks.
  • Tests

    • Added regression coverage to verify claim metadata is reset correctly.

Second path (CodeRabbit finding, REAL, folded in da43b41)

The generic update_task edit path (owner/admin PATCH; agents are blocked from status by 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:

>       assert back["claimed_by"] is None
E       AssertionError: assert 'agent-1' is None
FAILED tests/projects/test_task_store.py::test_update_task_status_open_returns_task_to_claimable_pool

Fixed by clearing claim metadata when a generic edit sets status='open' (also emitted in the task.updated patch). 27/27 green in the file post-fix.

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-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

unquarantine_task now clears claim ownership and timestamps when reopening a quarantined task. A regression test confirms that another agent can claim the reopened task. The changelog documents the behavior.

Changes

Unquarantine claim reset

Layer / File(s) Summary
Clear claim metadata when reopening tasks
tinyagentos/projects/task_store.py, tests/projects/test_task_store.py, changelog.d/tsk-y6x6s4-unquarantine-claimer.md
unquarantine_task clears claimed_by and claimed_at. The regression test verifies that another agent can claim the reopened task. The changelog records the behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • jaylfc/taOS#2333: Directly introduced the unquarantine_task behavior changed here.
  • jaylfc/taOS#2347: Also modifies task lifecycle state and claim metadata handling.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: unquarantining a task returns it to a claimable pool.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch exec/tsk-y6x6s4

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

@kilo-code-bot

kilo-code-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • changelog.d/tsk-y6x6s4-unquarantine-claimer.md
  • tests/projects/test_task_store.py
  • tinyagentos/projects/task_store.py
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)
  • changelog.d/tsk-y6x6s4-unquarantine-claimer.md
  • tests/projects/test_task_store.py
  • tinyagentos/projects/task_store.py

Reviewed by step-3.7-flash · Input: 90.1K · Output: 9K · Cached: 233.3K

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2eb1a8f and 2aabf13.

📒 Files selected for processing (3)
  • changelog.d/tsk-y6x6s4-unquarantine-claimer.md
  • tests/projects/test_task_store.py
  • tinyagentos/projects/task_store.py

Comment thread tinyagentos/projects/task_store.py
@jaylfc

jaylfc commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

nemotron-super review

VERDICT: Pass
No blocking issues found

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.
@jaylfc
jaylfc merged commit 6c3a7e7 into dev Aug 12, 2026
22 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