Fix workspace dispatch: kanban workspace_kind is 'dir', block on dispatch 4xx

- Hermes rejects workspace_kind 'path' (valid: dir/scratch/worktree).
- Dispatch failure now blocks the work item with a dispatch.failed event
  instead of retrying the same 400 every tick.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
fez5587andClaude Fable 5 committed 2026-08-04 10:15:05 -05:00
1 parent 4fd6f3fd1d
commit 9a1b03b15e
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -113,8 +113,13 @@ class Dispatcher:
)
await self.hermes.dispatch_now()
except HermesError as e:
# block instead of retrying every tick: dispatch 4xx is config, not transient
log.warning("dispatch failed for %s: %s", item["id"], e)
async with db.pool.connection() as conn:
async with conn.transaction():
await conn.execute(
"UPDATE work_item SET status='blocked', updated_at=now() WHERE id=%s",
(item["id"],))
await db.append_event(conn, actor="system", event_type="dispatch.failed",
company_id=item["company_id"], work_item_id=item["id"],
payload={"error": str(e)[:300]})
+1 -1
View File
@@ -134,7 +134,7 @@ class HermesClient:
"triage": False,
}
if workspace_path:
payload["workspace_kind"] = "path"
payload["workspace_kind"] = "dir"
payload["workspace_path"] = workspace_path
data = await self._json("POST", "/api/plugins/kanban/tasks", json=payload)
return data.get("task", data)