MCPcopy Create free account
hub / github.com/avibe-bot/avibe / load_watch_runtime

Method load_watch_runtime

storage/background.py:1091–1109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1089 conn.execute(insert(agent_runs).values(**values))
1090
1091 def load_watch_runtime(self) -> dict[str, Any]:
1092 with self.engine.connect() as conn:
1093 rows = conn.execute(
1094 select(agent_runs)
1095 .where(agent_runs.c.run_type == "watch_runtime")
1096 .where(agent_runs.c.status == "running")
1097 ).mappings()
1098 watches: dict[str, Any] = {}
1099 for row in rows:
1100 payload = _json_loads(row["metadata_json"], {})
1101 watch_id = row["definition_id"]
1102 if watch_id:
1103 watches[str(watch_id)] = {
1104 "running": True,
1105 "pid": row["pid"],
1106 "started_at": row["started_at"],
1107 "updated_at": row["updated_at"],
1108 } | (payload if isinstance(payload, dict) else {})
1109 return {"watches": watches}
1110
1111 def _scheduled_task_values(self, payload: dict[str, Any]) -> dict[str, Any]:
1112 return {

Callers 4

loadMethod · 0.80
harness_watches_listFunction · 0.80
harness_watch_patchFunction · 0.80
harness_bootstrapFunction · 0.80

Calls 2

_json_loadsFunction · 0.70
connectMethod · 0.45

Tested by

no test coverage detected