fix(quick-pane): restore model catalog controls

This commit is contained in:
2026-08-25 22:34:58 +02:00
parent ab482d3daa
commit 1b0b34fad8
10 changed files with 706 additions and 170 deletions
+15 -9
View File
@@ -987,7 +987,7 @@ test("closing retains a saved-session lease until the child stops", async () =>
await registry.stop();
});
test("first migration retains a missing legacy session as failed dormant intent", async () => {
test("first migration retains missing intent and starts an idle home runtime", async () => {
const paths = await fixture();
const sessionDir = sessionDirectoryPath(paths.sessionRoot, paths.home);
const missing = join(sessionDir, "missing.jsonl");
@@ -1003,14 +1003,18 @@ test("first migration retains a missing legacy session as failed dormant intent"
startAdapter: adapters.startAdapter,
});
await registry.start();
const runtime = registry.getWorkspace().directories[0].runtimes[0];
assert.equal(runtime.state, "failed");
assert.equal(runtime.sessionPath, missing);
assert.equal(adapters.calls.length, 0);
const runtimes = registry.getWorkspace().directories[0].runtimes;
const failed = runtimes.find((runtime) => runtime.state === "failed");
const live = runtimes.find((runtime) => runtime.state === "idle");
assert.equal(failed.sessionPath, missing);
assert.equal(live.worktreePath, paths.home);
assert.equal(adapters.calls.length, 1);
const manifest = await readJson(
join(paths.sessionRoot, "bridge-workspace-v2.json"),
);
assert.equal(manifest.runtimes[0].sessionPath, missing);
assert.ok(
manifest.runtimes.some((runtime) => runtime.sessionPath === missing),
);
await registry.stop();
});
@@ -1198,7 +1202,7 @@ test("snapshot rejects results from an adapter replaced during recovery", async
await registry.stop();
});
test("closing the last runtime persists a zero-runtime restart", async () => {
test("restoration with no live adapter starts one idle home runtime", async () => {
const paths = await fixture();
const firstAdapters = adapterFactory();
const first = createAgentRegistry({
@@ -1216,8 +1220,10 @@ test("closing the last runtime persists a zero-runtime restart", async () => {
startAdapter: restoredAdapters.startAdapter,
});
await restored.start();
assert.equal(restored.getWorkspaceSummary().openCount, 0);
assert.equal(restoredAdapters.calls.length, 0);
assert.equal(restored.getWorkspaceSummary().openCount, 1);
assert.equal(restoredAdapters.calls.length, 1);
assert.equal(restored.listAgents()[0].worktreePath, paths.home);
assert.equal(restored.listAgents()[0].state, "idle");
await restored.stop();
});