0de34c1f13
Composition bug between the salvaged #101266 (in-place v29 startup migration: swap the trigram view/triggers, FTS5 'rebuild') and #88217 (FTS_STORAGE_VERSION 2 drops the tool_calls column from the trigram vtable, opt-in via optimize-storage). On an install still carrying the v1 vtable, the startup migration replaced the view with one that has no tool_calls, then 'rebuild' failed with 'no such column: T.tool_calls' and SessionDB.__init__ raised — reproduced by opening a real main-built DB. Gate the in-place migration on the vtable not projecting tool_calls; such installs are already offered optimize-storage, which recreates the vtable from FTS_TRIGRAM_SQL (cron-filtered view included). E2E: main-built DB -> opens on this branch, optimize_fts_storage() yields v2 columns and purges the cron row. Test fixture now builds a real external-content vtable for both layouts; new test mutation-checked against the missing guard.