mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:40:44 +00:00
fix: pass MCP config to tool policies
This commit is contained in:
@@ -43,7 +43,7 @@ const resolveGatewayScopedToolsMock = vi.hoisted(() =>
|
||||
})),
|
||||
);
|
||||
|
||||
vi.mock("../config/config.js", () => ({
|
||||
vi.mock("../config/io.js", () => ({
|
||||
getRuntimeConfig: () => ({ session: { mainKey: "main" } }),
|
||||
}));
|
||||
|
||||
@@ -452,6 +452,7 @@ describe("mcp loopback server", () => {
|
||||
params: { body: "hello" },
|
||||
ctx: expect.objectContaining({
|
||||
agentId: "main",
|
||||
config: { session: { mainKey: "main" } },
|
||||
sessionKey: "agent:main:main",
|
||||
}),
|
||||
signal: expect.any(AbortSignal),
|
||||
|
||||
@@ -132,6 +132,7 @@ export async function startMcpLoopbackServer(port = 0): Promise<{
|
||||
toolSchema: scopedTools.toolSchema,
|
||||
hookContext: {
|
||||
agentId: scopedTools.agentId,
|
||||
config: cfg,
|
||||
sessionKey: requestContext.sessionKey,
|
||||
},
|
||||
signal: requestAbort.signal,
|
||||
|
||||
Reference in New Issue
Block a user