* One-line liveness signal per sweep. Distinguishes "still reconciling" from * "dead" for anyone tailing stdout or polling with `AwaitShell`.
(mgr: AgentManager)
| 238 | * "dead" for anyone tailing stdout or polling with `AwaitShell`. |
| 239 | */ |
| 240 | function printSweepHeartbeat(mgr: AgentManager): void { |
| 241 | const counts = mgr.tasks.reduce<Record<string, number>>((acc, s) => { |
| 242 | acc[s.status] = (acc[s.status] ?? 0) + 1; |
| 243 | return acc; |
| 244 | }, {}); |
| 245 | const order = [ |
| 246 | "pending", |
| 247 | "running", |
| 248 | "handed-off", |
| 249 | "error", |
| 250 | "cancelled", |
| 251 | "pruned", |
| 252 | ]; |
| 253 | const parts = order |
| 254 | .filter(status => (counts[status] ?? 0) > 0) |
| 255 | .map(status => `${status}=${counts[status]}`); |
| 256 | const andon = isAndonActive(mgr.state.andon) ? " ANDON" : ""; |
| 257 | console.log( |
| 258 | `[${new Date().toISOString()}] sweep ${mgr.plan.rootSlug}: ${parts.join(" ") || "(no tasks)"}${andon}` |
| 259 | ); |
| 260 | } |
| 261 | |
| 262 | function printLoopSummary(mgr: AgentManager): void { |
| 263 | const counts = mgr.tasks.reduce<Record<string, number>>((acc, s) => { |
no test coverage detected