mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-30 05:02:58 +00:00
feat(plugins): reopen idle agent sessions after hook changes
Defer automatic plugin changes until the next idle prompt so running turns keep steering. Expose session reload separately from snapshot refresh in the SDK.
This commit is contained in:
@@ -246,3 +246,22 @@ describe("plugin agent tools SDK boundary", () => {
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("agent session reload SDK boundary", () => {
|
||||
it("exposes reload separately from snapshot refresh", () => {
|
||||
expect(
|
||||
typeErrors(`
|
||||
import { type PluginServerContext } from "@getpaseo/plugin/server";
|
||||
import { type PaseoAgentRefetchResult } from "@getpaseo/client";
|
||||
async function reload(server: PluginServerContext, paseo: import("@getpaseo/client").PaseoApi) {
|
||||
const agent = paseo.agents.ref("chosen-agent");
|
||||
const read: PaseoAgentRefetchResult | null = await agent.refresh("read-snapshot");
|
||||
const reopened: PaseoAgentRefetchResult | null = await agent.reload({ requestId: "reload-session" });
|
||||
await agent.reload();
|
||||
// @ts-expect-error reload options can grow without a positional signature change
|
||||
await agent.reload("reload-session");
|
||||
}
|
||||
`),
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user