Skip to content

Commit a3f64c1

Browse files
authored
test(node): cover trusted invoke session binding (#128415)
Adopted from Microsoft's Lobster patch 0028 via giodl73-repo/lobster-plugins-and-patches (source commit e9f84234ebdf).
1 parent 99c35c8 commit a3f64c1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/node-host/invoke.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ describe("node host invoke", () => {
212212
| NonNullable<OpenClawPluginNodeHostCommandContext["acquireManagedWorkspace"]>
213213
| undefined;
214214
const handle = vi.fn<OpenClawPluginNodeHostCommand["handle"]>(
215-
async (_paramsJSON, _io, context) => {
215+
async (paramsJSON, _io, context) => {
216+
expect(JSON.parse(paramsJSON ?? "{}")).toEqual({ sessionKey: "agent:main:other" });
217+
expect(context?.sessionKey).toBe(workspaceRequest.sessionKey);
216218
const acquire = context?.acquireManagedWorkspace;
217219
if (!acquire) {
218220
throw new Error("managed workspace authority missing");
@@ -245,7 +247,7 @@ describe("node host invoke", () => {
245247
id: "invoke-workspace",
246248
nodeId: "node-1",
247249
command: "workspace.claim",
248-
paramsJSON: "{}",
250+
paramsJSON: JSON.stringify({ sessionKey: "agent:main:other" }),
249251
sessionKey: workspaceRequest.sessionKey,
250252
},
251253
{ request } as unknown as GatewayClient,

0 commit comments

Comments
 (0)