memory.dashboard.backend.routes.coordinator¶
memory.dashboard.backend.routes.coordinator ¶
Coordinator-status routes (local + federated).
Split out of the former flat routes.py; behaviour is unchanged.
get_coordinator_agents ¶
Return the merged coordinator agent roster.
Combines the built-in agents (coordinator/agents.py) with any
project-local agents and built-in overrides declared in agents.yaml
(discovered via AGENTS_FILE env > .cursor/ > .claude/). This is the same
roster the coordinator's agents(action="list") tool exposes, so the workflow
builder palette stays in sync with what the coordinator can actually spawn.
Returns:
| Type | Description |
|---|---|
dict
|
A mapping |
Source code in memory/dashboard/backend/routes/coordinator.py
get_coordinator_status ¶
Return coordinator graphs, one per run.
Merges runs from both canonical and legacy state files. Filters out empty ghost runs (total == 0 with no tasks).
Handles two state file formats:
- New: {"runs": [...]} with per-run metadata
- Legacy: flat task list — split into connected components via union-find
Answers conditional GETs: an ETag from :func:_coordinator_status_etag_key
(the state-file signature plus a live-run time bucket) lets an unchanged 2s
poll collapse to a bodyless 304, skipping the whole assembly.
Source code in memory/dashboard/backend/routes/coordinator.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
get_federated_coordinator_status ¶
Report coordinator activity in each configured federated repo.
Federation otherwise only reads committed graph data; this reaches one step
further and reads each peer's gitignored .angelo/coordinator-state.json
sidecar — a sibling of the .memory dir whose path federation already
resolves — so the dashboard can tell when a coordinator is running in
another repo. Read-only and best-effort: an unreachable or malformed peer
yields runs: [] rather than an error.
Per-task detail is included so the dashboard can expand a federated run's graph inline, but "View in tree" stays disabled for these — a federated run targets entries in the peer's tree, which can't be opened in the local overlay. Liveness reuses the same heartbeat staleness rule as the local endpoint.
Source code in memory/dashboard/backend/routes/coordinator.py
update_coordinator_run ¶
Rename a stale or completed coordinator run's goal (its card title).
Refuses active runs (a live coordinator owns and would overwrite them).
Source code in memory/dashboard/backend/routes/coordinator.py
delete_coordinator_run ¶
Delete a stale or completed coordinator run from the state file.
Refuses active runs (a live coordinator owns them and would re-add them).
Source code in memory/dashboard/backend/routes/coordinator.py
finalize_coordinator_run ¶
Mark a stale coordinator run as complete instead of deleting it.
Cancels any task that never finished (pending/running -> cancelled), recomputes the summary so the run reads as terminally complete, and moves it into the completed history -- preserving its already-done work and results. Refuses active runs (a live coordinator owns them and would revert the change). Already-completed runs are a no-op success.
Source code in memory/dashboard/backend/routes/coordinator.py
delete_federated_coordinator_run ¶
Delete a stale or completed coordinator run from a federated peer repo.
Cleanup only: refuses active runs (a live coordinator in the peer repo owns them and would re-add them on its next heartbeat).
Source code in memory/dashboard/backend/routes/coordinator.py
finalize_federated_coordinator_run ¶
Mark a stale coordinator run in a federated peer repo as complete.
Cancels any unrun task and archives the run as complete — the federated analogue of the local finalize endpoint. Refuses active runs; an already-completed run is a no-op success.