fix(db): keep router_profile through the legacy lanes rebuild

The (cwd, tool) rebuild lists its columns by hand and omitted
router_profile, which its probe adds earlier in the same start — a legacy
DB lost the column (and every lane's router) until the next restart.
This commit is contained in:
2026-09-23 13:20:40 +07:00
parent 99a2a8277c
commit 40fe41bb77
2 changed files with 15 additions and 1 deletions
@@ -85,6 +85,17 @@ describe("legacy lanes_new rebuild (pre-tool, single-column cwd UNIQUE DB)", ()
assert.equal(row.tool, "claude");
});
it("keeps every column added before the rebuild, router_profile included", () => {
const { db } = require("../db");
const cols = db
.prepare("PRAGMA table_info(lanes)")
.all()
.map((c) => c.name);
for (const name of ["router_profile", "needs_action_session"]) {
assert.ok(cols.includes(name), `expected ${name} to survive the rebuild`);
}
});
it("recreates idx_lanes_session and idx_lanes_slot", () => {
const { db } = require("../db");
for (const name of ["idx_lanes_session", "idx_lanes_slot"]) {