Background
WorkflowRunStatus includes deprecated values 'sleeping' and 'succeeded' kept for backward compatibility. New runs use 'running' and 'completed' respectively. Both backends are aware of the mapping (e.g., toWorkflowRunCounts folds deprecated statuses into their replacements).
Problem
listWorkflowRuns({ status: 'running' }) generates WHERE "status" = 'running', which excludes rows with status = 'sleeping'. Similarly, status: 'completed' excludes 'succeeded' rows. During or after a rolling upgrade where both statuses coexist, callers see incomplete lists.
Expected Behavior
Filtering by status: 'running' returns rows with either 'running' or 'sleeping'. Filtering by status: 'completed' returns rows with either 'completed' or 'succeeded'.
Proposed Solution
Define a mapping in core/workflow-run.ts:
const STATUS_ALIASES = { running: ['running', 'sleeping'], completed: ['completed', 'succeeded'] }
Apply it when building the WHERE clause in both backends, using IN (…) instead of = … for the affected statuses.
Acceptance Criteria
Integration test: insert a run with status = 'sleeping' directly. listWorkflowRuns({ status: 'running' }) includes it.
Integration test: insert a run with status = 'succeeded' directly. listWorkflowRuns({ status: 'completed' }) includes it.
Dashboard displays accurate run counts after upgrade.
Both Postgres and SQLite backends pass.
Background
WorkflowRunStatus includes deprecated values 'sleeping' and 'succeeded' kept for backward compatibility. New runs use 'running' and 'completed' respectively. Both backends are aware of the mapping (e.g., toWorkflowRunCounts folds deprecated statuses into their replacements).
Problem
listWorkflowRuns({ status: 'running' }) generates WHERE "status" = 'running', which excludes rows with status = 'sleeping'. Similarly, status: 'completed' excludes 'succeeded' rows. During or after a rolling upgrade where both statuses coexist, callers see incomplete lists.
Expected Behavior
Filtering by status: 'running' returns rows with either 'running' or 'sleeping'. Filtering by status: 'completed' returns rows with either 'completed' or 'succeeded'.
Proposed Solution
Define a mapping in core/workflow-run.ts:
const STATUS_ALIASES = { running: ['running', 'sleeping'], completed: ['completed', 'succeeded'] }
Apply it when building the WHERE clause in both backends, using IN (…) instead of = … for the affected statuses.
Acceptance Criteria
Integration test: insert a run with status = 'sleeping' directly. listWorkflowRuns({ status: 'running' }) includes it.
Integration test: insert a run with status = 'succeeded' directly. listWorkflowRuns({ status: 'completed' }) includes it.
Dashboard displays accurate run counts after upgrade.
Both Postgres and SQLite backends pass.