feat(rpc): add validated desktop Pi RPC command palette
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user