From 0f6b5c44388831bb9710161116654f7d6dc8ed59 Mon Sep 17 00:00:00 2001 From: "Hermes (debby)" Date: Fri, 19 Jun 2026 11:32:23 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20colibri=20task=20poller=20=E2=80=94=20a?= =?UTF-8?q?gents=20can=20check=20assigned=20tasks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scripts/colibri_poll.py: poll Colibri board for tasks assigned to an agent - PR opened on colibri: feat/cli-register-agent (register-agent + list-agents CLI) --- scripts/colibri_poll.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/colibri_poll.py diff --git a/scripts/colibri_poll.py b/scripts/colibri_poll.py new file mode 100755 index 0000000..49d4f88 --- /dev/null +++ b/scripts/colibri_poll.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +"""Colibri task poller — checks the board for tasks assigned to an agent.""" +import json, subprocess, sys, argparse + +def poll(agent_name, socket_path, colibri_bin="colibri"): + result = subprocess.run( + [colibri_bin, "--socket", socket_path, "list-tasks", "--status", "started"], + capture_output=True, text=True, timeout=10 + ) + tasks = json.loads(result.stdout) + mine = [t for t in tasks if t.get("agent_name") == agent_name or t.get("agent_id") == agent_name] + print(json.dumps(mine, indent=2)) + return 0 if mine else 1 + +if __name__ == "__main__": + p = argparse.ArgumentParser() + p.add_argument("--agent", required=True) + p.add_argument("--socket", required=True) + p.add_argument("--colibri", default="colibri") + args = p.parse_args() + sys.exit(poll(args.agent, args.socket, args.colibri))