diff --git a/api/routers/state.py b/api/routers/state.py index 28ab4c2..215305b 100644 --- a/api/routers/state.py +++ b/api/routers/state.py @@ -339,11 +339,12 @@ async def _derive_next_steps(session: AsyncSession) -> list[NextStep]: if task.id in seen_task_ids: continue domain_slug = await _get_domain_slug_for_workstream(from_ws, session) - blocker_slugs = ", ".join( - (await session.get(Workstream, tid)).slug - for tid in to_ws_ids - if await session.get(Workstream, tid) - ) + _blocker_slugs = [] + for tid in to_ws_ids: + _ws = await session.get(Workstream, tid) + if _ws: + _blocker_slugs.append(_ws.slug) + blocker_slugs = ", ".join(_blocker_slugs) steps.append(NextStep( type="dependency_cleared", domain=domain_slug,