Skip to content

Commit 42fac6a

Browse files
committed
Fix: Add blockedBy check in claim_task to prevent LLM bypassing dependencies
1 parent 644b075 commit 42fac6a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

agents/s11_autonomous_agents.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ def claim_task(task_id: int, owner: str) -> str:
148148
if task.get("status") != "pending":
149149
status = task.get("status")
150150
return f"Error: Task {task_id} cannot be claimed because its status is '{status}'"
151+
if task.get("blockedBy"):
152+
return f"Error: Task {task_id} is blocked by other task(s) and cannot be claimed yet"
151153
task["owner"] = owner
152154
task["status"] = "in_progress"
153155
path.write_text(json.dumps(task, indent=2))

0 commit comments

Comments
 (0)