fix(orchestrator): dispatch pending tasks to claimed_by when assigned_to was cleared

A stale-claim reap can leave a task pending with assigned_to nulled but
claimed_by still set. _resolve_dev_owner_uuid only fell back to claimed_by for
claimed/blocked, so for pending it saw no owner and the dispatcher never
respawned anyone — the task went dormant. Fall back to claimed_by for pending
too, so the orchestrator still knows who to call after a half-reap.
This commit is contained in:
Renn F
2026-06-10 13:36:57 +02:00
parent 04dd132009
commit 06b0802f32
+8 -2
View File
@@ -5226,11 +5226,17 @@ Never `commit`, never write code, never run `git`. PMs coordinate.
@staticmethod
def _resolve_dev_owner_uuid(task: dict[str, Any]) -> str | None:
"""Pick the right owner UUID for dev dispatch based on status."""
"""Pick the right owner UUID for dev dispatch based on status.
Always falls back to ``claimed_by`` when ``assigned_to`` is missing, so
a task left half-reaped (assigned_to nulled but still claimed) still
dispatches to its rightful owner instead of going dormant the
orchestrator knows who to call even when one ownership field was cleared.
"""
status = task.get("status")
if status in ("claimed", "blocked"):
return task.get("claimed_by") or task.get("assigned_to")
return task.get("assigned_to")
return task.get("assigned_to") or task.get("claimed_by")
async def _respawn_dev_if_inactive(
self, task: dict[str, Any], agent_slug: str