Routines: run history and list status read fire outcomes (CL-6681) - #333
Merged
Conversation
Warm-keep deliberately leaves a routine fire's delivery agent deployed after it replies, so workflow_run.status never settles out of "running" on its own. These tests pin the fix: a fire's displayed status should read as its actual outcome (completed once its reply window has passed) rather than the raw, permanently-live column, both in health.ts's own unit tests and in the Routines list's rendered markup.
Deployment liveness and fire outcome are two different facts, and the Routines list's status cell and the detail page's run history table both badged the former: a fire's raw workflow_run.status, which warm-keep deliberately leaves at "running" once the delivery agent stays deployed after replying. That column never settles back down on its own, so every fire (and the routine's own health pill) read as "RUNNING NOW" forever, matching CL-6595's Mission Control fix in spirit (the fires feed's job is separating a real deployment from a fired run) but not in mechanism, since a routine's run history has no feed to re-point at — it is already the platform's own fire ledger. health.ts's new fireOutcomeStatus is the one place that tells a fire still doing work apart from one merely staying warm: a "running" status past FIRE_RUNNING_WINDOW_MS since the fire started reads as "completed" instead of taken literally. routineHealth, cleanFireStreak, and the health pill's own "latest fire is running" check all route through it, and so does the Routines page's RunStatusCell (which feeds both the global list's Last run column and the detail page's Run history table) — one function decides for every surface that badges a fire's status, the same rule health.ts already claims for itself.
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.
Summary
workflow_run.statusnever settles out ofrunningon its own — every fire (and the routine's own health pill) read as "RUNNING NOW" forever.fireOutcomeStatusto@corbits/routines'shealth.ts: the one place that tells a fire still doing work apart from one merely staying warm. Arunningstatus older thanFIRE_RUNNING_WINDOW_MS(10 minutes) since the fire started reads ascompletedinstead of taken literally.routineHealth,cleanFireStreak, and the Routines page'sRunStatusCell(shared by the global list's Last run column, the canvas panel's run table, and the detail page's Run history table) all through this one function, so every surface that badges a fire's status agrees.Root cause
GET /routines/:id/runsembeds each fire's run summary straight offworkflow_run(apps/hub/src/routine-run-summary.ts), and the platform never flips a warm-kept fire's status out ofrunning— it is deliberately left resident so the agent can handle follow-ups.RunStatusCellandroutineHealth'sstateAndWordsbadged that raw column directly, so a fire that had already delivered its reply displayed as perpetually in flight. This mirrors CL-6595's Mission Control fix in spirit (separating "deployed" from "did the actual work"), but not in mechanism — a routine's run history has no alternate feed to re-point at, since it's already the platform's own fire ledger, so the fix lives in@corbits/routines's own health/status vocabulary instead.Test plan
WORKBENCH_CHECK_SINCE=origin/main bun run typecheckWORKBENCH_CHECK_SINCE=origin/main bun run testbun run lint