* Progress is possible iff some task is running OR at least one pending task * could still have its deps satisfied (deps are all non-terminal or * already handed-off).
(mgr: AgentManager)
| 155 | * already handed-off). |
| 156 | */ |
| 157 | function canMakeProgress(mgr: AgentManager): boolean { |
| 158 | return mgr.tasks.some( |
| 159 | s => |
| 160 | s.status === "running" || |
| 161 | (s.status === "pending" && pendingCouldStillSpawn(mgr, s)) |
| 162 | ); |
| 163 | } |
| 164 | |
| 165 | function pendingCouldStillSpawn(mgr: AgentManager, task: TaskState): boolean { |
| 166 | // Ad-hoc tasks (not in plan.tasks) are never spawned by the reconcile |
no test coverage detected