feat(rpc): add validated desktop Pi RPC command palette

This commit is contained in:
2026-08-24 20:16:51 +02:00
parent 475f95ba70
commit 99084cc5a5
25 changed files with 2170 additions and 344 deletions
+39
View File
@@ -483,6 +483,45 @@ test("persists a first-prompt session when the runtime settles and awaits refres
assert.match(manifestText, new RegExp(createdPath.replaceAll("/", "\\/")));
});
test("does not persist an uncreated Pi session file across a restart", async () => {
const paths = await fixture();
const futurePath = join(
sessionDirectoryPath(paths.sessionRoot, paths.home),
"future.jsonl",
);
const adapters = adapterFactory({
stateFor: () => ({ sessionFile: futurePath, sessionId: "future-id" }),
});
const firstRegistry = createAgentRegistry({
homeWorktree: paths.home,
sessionRoot: paths.sessionRoot,
startAdapter: adapters.startAdapter,
});
await firstRegistry.start();
assert.equal(
firstRegistry.getWorkspace().directories[0].runtimes[0].sessionPath,
undefined,
);
await firstRegistry.stop();
const manifest = await readJson(
join(paths.sessionRoot, "bridge-workspace-v2.json"),
);
assert.equal(manifest.runtimes[0].sessionPath, undefined);
const restoredRegistry = createAgentRegistry({
homeWorktree: paths.home,
sessionRoot: paths.sessionRoot,
startAdapter: adapters.startAdapter,
});
await restoredRegistry.start();
const restored = restoredRegistry.getWorkspace().directories[0].runtimes[0];
assert.equal(restored.state, "idle");
assert.equal(restored.sessionPath, undefined);
assert.equal(adapters.calls[1].options.sessionPath, undefined);
await restoredRegistry.stop();
});
test("extension responses do not clear unrelated error attention", async () => {
const paths = await fixture();
const adapters = adapterFactory();