v2.0: Multi-user platform with agent catalog, admin panel, LLM providers

This commit is contained in:
2026-04-13 02:21:45 +00:00
parent b299ea701a
commit 26156543f6
8 changed files with 1002 additions and 580 deletions
+10 -12
View File
@@ -33,19 +33,17 @@ def api_request(url, data=None, headers=None, method="GET"):
return json.loads(resp.read().decode())
def log_run(agent_id, status, output="", err="", metadata=None):
"""Log a run to the dashboard API."""
def log_run(agent_id, status, output="", err="", metadata=None, instance_id=None):
"""Log a run to the dashboard API. Uses instance_id if available (v2), falls back to agent_id."""
try:
api_request(
f"{DASHBOARD_API}/api/agents/{agent_id}/runs",
data={
"status": status,
"output": output,
"error": err,
"metadata": metadata or {},
},
method="POST",
)
if instance_id:
api_request(
f"{DASHBOARD_API}/api/instances/{instance_id}/runs",
data={"status": status, "output": output, "error": err, "metadata": metadata or {}},
method="POST",
)
else:
print(f"Warning: no instance_id, run not logged for {agent_id}", file=sys.stderr)
except Exception as e:
print(f"Warning: failed to log run to dashboard: {e}", file=sys.stderr)