feat: add multi-session desktop workspace
This commit is contained in:
@@ -115,6 +115,40 @@ test("requests Pi session statistics for context and token status", async () =>
|
||||
await adapter.stop();
|
||||
});
|
||||
|
||||
test("forwards native session naming and compaction commands", async () => {
|
||||
const fixture = createFixture();
|
||||
const adapter = startPiRpcAdapter({
|
||||
cwd: "/workspace/home",
|
||||
sessionDir: "/workspace/sessions",
|
||||
spawnProcess: fixture.spawn,
|
||||
});
|
||||
|
||||
const named = adapter.send({ type: "set_session_name", name: "Release UI" });
|
||||
const [nameCommand] = fixture.sent();
|
||||
assert.equal(nameCommand.type, "set_session_name");
|
||||
assert.equal(nameCommand.name, "Release UI");
|
||||
fixture.child.stdout.write(
|
||||
`${JSON.stringify({ type: "response", id: nameCommand.id, command: "set_session_name", success: true })}\n`,
|
||||
);
|
||||
await named;
|
||||
|
||||
const compacted = adapter.send({
|
||||
type: "compact",
|
||||
customInstructions: "Preserve implementation details",
|
||||
});
|
||||
const [, compactCommand] = fixture.sent();
|
||||
assert.equal(compactCommand.type, "compact");
|
||||
assert.equal(
|
||||
compactCommand.customInstructions,
|
||||
"Preserve implementation details",
|
||||
);
|
||||
fixture.child.stdout.write(
|
||||
`${JSON.stringify({ type: "response", id: compactCommand.id, command: "compact", success: true })}\n`,
|
||||
);
|
||||
await compacted;
|
||||
await adapter.stop();
|
||||
});
|
||||
|
||||
test("forwards extension responses without replacing Pi's request ID", async () => {
|
||||
const fixture = createFixture();
|
||||
const events = [];
|
||||
|
||||
Reference in New Issue
Block a user