fix(mcp): pass tool input as permission metadata (#51062)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
Luca Barbato 2026-10-15 01:52:52 +02:00 • committed by GitHub
parent 32b1a1bf85
commit 328f74c213
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -52,7 +52,7 @@ export const layer = Layer.effect(
action: name(tool.server, tool.name),
resources: ["*"],
save: ["*"],
metadata: {},
metadata: { input: input ?? {} },
sessionID: context.sessionID,
agent: context.agent,
source: {

View file

@ -2513,7 +2513,7 @@ it.effect("waits for permission before calling an MCP tool", () =>
type: "tool-call",
id: "call_mcp_permission",
name: "execute",
input: { code: "return await tools.demo.search({})" },
input: { code: 'return await tools.demo.search({ query: "open issues" })' },
},
})
.pipe(Effect.forkScoped)
@ -2521,7 +2521,7 @@ it.effect("waits for permission before calling an MCP tool", () =>
action: "demo_search",
resources: ["*"],
save: ["*"],
metadata: {},
metadata: { input: { query: "open issues" } },
sessionID: Session.ID.make("ses_mcp_permission"),
agent: toolIdentity.agent,
source: {