auto-sync: 2026-05-21 22:33:19
This commit is contained in:
@@ -480,6 +480,20 @@ class Ticker:
|
||||
result.get("session_id"))
|
||||
finally:
|
||||
conn.close()
|
||||
elif result["status"] == "blocked":
|
||||
# Guardrail 拦截:任务标记为 blocked
|
||||
conn = get_connection(db_path)
|
||||
try:
|
||||
self._transition_status(
|
||||
conn, task.id, "blocked",
|
||||
agent="daemon",
|
||||
detail={"reason": result.get("reason", "guardrail"),
|
||||
"violations": result.get("violations", [])},
|
||||
)
|
||||
logger.info("Task %s blocked by guardrail: %s",
|
||||
task.id, result.get("reason", "unknown"))
|
||||
finally:
|
||||
conn.close()
|
||||
except Exception:
|
||||
logger.exception("Dispatch failed for %s", task.id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user