The container opens inbound.db read-only, so it can't ALTER TABLE. If the host hasn't run migrateMessagesInTable yet (e.g., container rebuilt before host restart), the on_wake column won't exist and the query crashes, causing a restart loop. Detect the column via PRAGMA table_info and conditionally include the filter clause. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>