fix: filter gateway node list locally · openclaw/openclaw@f85806b
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -526,6 +526,29 @@ describe("loadGatewayPlugins", () => {
|
526 | 526 | expect(typeof subagent?.getSession).toBe("function"); |
527 | 527 | }); |
528 | 528 | |
| 529 | +test("filters connected plugin nodes locally without sending unsupported node.list params", async () => { |
| 530 | +loadOpenClawPlugins.mockReturnValue(createRegistry([])); |
| 531 | +loadGatewayStartupPluginsForTest(); |
| 532 | +serverPluginsModule.setFallbackGatewayContext(createTestContext("nodes-list-filter")); |
| 533 | +handleGatewayRequest.mockImplementationOnce(async (opts: HandleGatewayRequestOptions) => { |
| 534 | +expect(opts.req.method).toBe("node.list"); |
| 535 | +opts.respond(true, { |
| 536 | +nodes: [ |
| 537 | +{ nodeId: "connected", connected: true }, |
| 538 | +{ nodeId: "offline", connected: false }, |
| 539 | +], |
| 540 | +}); |
| 541 | +}); |
| 542 | + |
| 543 | +const runtime = runtimeModule.createPluginRuntime({ |
| 544 | +allowGatewaySubagentBinding: true, |
| 545 | +}); |
| 546 | +const result = await runtime.nodes.list({ connected: true }); |
| 547 | + |
| 548 | +expect(getLastDispatchedParams()).toEqual({}); |
| 549 | +expect(result.nodes).toEqual([{ nodeId: "connected", connected: true }]); |
| 550 | +}); |
| 551 | + |
529 | 552 | test("forwards provider and model overrides when the request scope is authorized", async () => { |
530 | 553 | const serverPlugins = serverPluginsModule; |
531 | 554 | const runtime = await createSubagentRuntime(serverPlugins); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。