From 42fac6af5aea3638bd6840070cd2661e86a7b7a1 Mon Sep 17 00:00:00 2001 From: chablino Date: Mon, 23 Mar 2026 22:42:24 +0800 Subject: [PATCH] Fix: Add blockedBy check in claim_task to prevent LLM bypassing dependencies --- agents/s11_autonomous_agents.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agents/s11_autonomous_agents.py b/agents/s11_autonomous_agents.py index 5f19074..721d049 100644 --- a/agents/s11_autonomous_agents.py +++ b/agents/s11_autonomous_agents.py @@ -148,6 +148,8 @@ def claim_task(task_id: int, owner: str) -> str: if task.get("status") != "pending": status = task.get("status") return f"Error: Task {task_id} cannot be claimed because its status is '{status}'" + if task.get("blockedBy"): + return f"Error: Task {task_id} is blocked by other task(s) and cannot be claimed yet" task["owner"] = owner task["status"] = "in_progress" path.write_text(json.dumps(task, indent=2))