mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 20:45:37 +02:00
Remove the concurrency_policy system (skip/queue/replace) — skip had an orphan bug that permanently blocked triggers, queue didn't actually queue, and replace didn't cancel running tasks. Every trigger now simply executes. Bug fixes: - Listener now handles in_review status (was silently ignored) - Issue deletion fails linked autopilot runs before DELETE (prevents orphans) - ComputeNextRun rejects invalid timezones instead of silent UTC fallback - dispatchCreateIssue post-commit failures now properly fail the run Reliability: - Scheduler recovers lost triggers on startup (crash recovery) - New index on autopilot_run(issue_id) for deletion lookups - Migration 043 cleans up historical orphaned/skipped/pending runs
17 lines
839 B
SQL
17 lines
839 B
SQL
-- Drop the issue_id index added in the up migration.
|
|
DROP INDEX IF EXISTS idx_autopilot_run_issue;
|
|
|
|
-- Restore the original partial status index.
|
|
DROP INDEX IF EXISTS idx_autopilot_run_status;
|
|
CREATE INDEX IF NOT EXISTS idx_autopilot_run_status ON autopilot_run(autopilot_id, status)
|
|
WHERE status IN ('pending', 'issue_created', 'running');
|
|
|
|
-- Restore concurrency_policy column.
|
|
ALTER TABLE autopilot ADD COLUMN IF NOT EXISTS concurrency_policy TEXT NOT NULL DEFAULT 'skip'
|
|
CHECK (concurrency_policy IN ('skip', 'queue', 'replace'));
|
|
|
|
-- Restore the original status CHECK constraint.
|
|
ALTER TABLE autopilot_run DROP CONSTRAINT IF EXISTS autopilot_run_status_check;
|
|
ALTER TABLE autopilot_run ADD CONSTRAINT autopilot_run_status_check
|
|
CHECK (status IN ('pending', 'issue_created', 'running', 'skipped', 'completed', 'failed'));
|