From 39290957aea0704de37ef7f5ca115ca3290fa79e Mon Sep 17 00:00:00 2001 From: indifferentketchup Date: Wed, 3 Jun 2026 00:29:28 +0000 Subject: [PATCH] fix(coder): drop human_inbox view before dropping tasks columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The audit-cleanup migration dropped tasks.feature_values/worktree_path, but human_inbox is `SELECT * FROM tasks` and pins every column, so the DROP COLUMN failed (2BP01) on any existing DB and crash-looped boocoder on boot. Drop the view, drop the columns, then recreate it — idempotent on fresh and existing DBs. --- apps/coder/src/schema.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/coder/src/schema.sql b/apps/coder/src/schema.sql index 58b9e66..1e49f00 100644 --- a/apps/coder/src/schema.sql +++ b/apps/coder/src/schema.sql @@ -75,8 +75,14 @@ ALTER TABLE tasks ADD COLUMN IF NOT EXISTS mode_id TEXT; ALTER TABLE tasks ADD COLUMN IF NOT EXISTS thinking_option_id TEXT; -- tasks.feature_values and tasks.worktree_path were never read or written by any -- code path; drop them from existing DBs (fresh DBs never had them in the CREATE). +-- human_inbox is `SELECT *` over tasks, so it pins every task column — dropping a +-- column while the view exists fails (2BP01). Drop the view, drop the columns, then +-- recreate it with the current column set (idempotent on fresh + existing DBs). +DROP VIEW IF EXISTS human_inbox; ALTER TABLE tasks DROP COLUMN IF EXISTS feature_values; ALTER TABLE tasks DROP COLUMN IF EXISTS worktree_path; +CREATE OR REPLACE VIEW human_inbox AS + SELECT * FROM tasks WHERE state IN ('blocked', 'failed'); -- v2.6: one backend session per (session, agent); resumed on switch-back. CREATE TABLE IF NOT EXISTS agent_sessions (