fix: pass MCP config to tool policies

This commit is contained in:
Eva
2026-05-01 23:35:02 +07:00
committed by Josh Lehman
parent 870babd252
commit 5d1607de06
2 changed files with 3 additions and 1 deletions

View File

@@ -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),

View File

@@ -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,