mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
feat(kanban): add reclaim_first support to bulk reassign endpoint
- Extend BulkTaskBody with reclaim_first: bool = False
- In bulk_update, use kanban_db.reassign_task(..., reclaim_first=True)
when payload.reclaim_first is set and assignee is present
- Falls back to existing assign_task behavior when reclaim_first is false
This enables the dashboard to bulk-reassign running tasks by
reclaiming their claims first, matching the single-task
/tasks/{id}/reassign endpoint behavior.
This commit is contained in:
parent
a63a2b7c78
commit
518d37f6af
1 changed files with 11 additions and 3 deletions
|
|
@ -823,6 +823,7 @@ class BulkTaskBody(BaseModel):
|
|||
result: Optional[str] = None
|
||||
summary: Optional[str] = None
|
||||
metadata: Optional[dict] = None
|
||||
reclaim_first: bool = False
|
||||
|
||||
|
||||
@router.post("/tasks/bulk")
|
||||
|
|
@ -877,9 +878,16 @@ def bulk_update(payload: BulkTaskBody, board: Optional[str] = Query(None)):
|
|||
entry.update(ok=False, error=f"transition to {s!r} refused")
|
||||
if payload.assignee is not None:
|
||||
try:
|
||||
if not kanban_db.assign_task(
|
||||
conn, tid, payload.assignee or None,
|
||||
):
|
||||
if payload.reclaim_first:
|
||||
ok = kanban_db.reassign_task(
|
||||
conn, tid, payload.assignee or None,
|
||||
reclaim_first=True,
|
||||
)
|
||||
else:
|
||||
ok = kanban_db.assign_task(
|
||||
conn, tid, payload.assignee or None,
|
||||
)
|
||||
if not ok:
|
||||
entry.update(ok=False, error="assign refused")
|
||||
except RuntimeError as e:
|
||||
entry.update(ok=False, error=str(e))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue