Mission Control: count routine fires via the fires feed (CL-6595) - #329
Merged
Conversation
The shell's "Running" band and Mission Control's active-run count both source `listRoutineActivity`, which called `listTopLevelRuns` -- the listing that excludes every folded run server-side. A routine's own fire is a folded run, so it could never appear there: a routine genuinely running showed "0 active" on Mission Control while the Routines page's own status pill (read off `workflow_run.status` directly) correctly said "Running now". These tests pin the fix: `listRoutineActivity` must read the `feed=fires` listing (which keeps a routine's fire, tagged with its routineId/routineName) and keep only rows that actually have a routine parent, dropping a directly-triggered deployment that isn't routine activity at all. They fail against the current `listTopLevelRuns`-based implementation.
…ne (CL-6595) Root cause of routine runs looking stuck on "Running now" forever while Mission Control simultaneously showed "0 active": the two surfaces read two different queries of the same run state. The Routines page's status pill reads `workflow_run.status` directly by run id (`@corbits/routines`' `health.ts`, via its `RunSummaryResolver`), so it reflects the run's real terminal status. Mission Control's active-run count and the shell's "Running" band instead came from `listRoutineActivity`, which called `listTopLevelRuns` -- a listing whose whole point is excluding every folded run (`notExists(folded_run)`) so the Agent Directory only shows genuine deployments. A routine's fire is launched through `launchFoldedRun` and is therefore always a folded run, so it never appeared in that listing at all: Mission Control's "active runs" count was structurally incapable of ever counting a routine, running or not. `listTopLevelRuns`'s sibling `feed=fires` listing already exists for exactly this shape of problem (Insights' run feed, CL-6249): it keeps a folded run when it is a confirmed routine fire, tagged with the routine's id and name, and still excludes every other folded run (workbench hosts, invited agents, tasks). `listRoutineActivity` now reads that feed through a new `listRoutineRunFires` client function and keeps only rows with a routine parent, so a running routine is visible (and counted) on Mission Control exactly when the Routines page's own pill says so, and a fire leaves that count the moment its status does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mission Control's active-run count read
listTopLevelRuns, which excludes every folded run server-side — and a routine fire is always a folded run, so it could structurally never be counted as running. The Routines page pill was already correct.Route routine activity through the existing
feed=fireslisting instead, filtered to routine-tagged fires.e0a9ad2f583217cfbun run checkgreen in the worktree.