diff options
| author | Andrew Pashynnyk <[email protected]> | 2025-10-23 18:38:55 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-10-23 10:38:55 -0500 |
| commit | 3c7b229d8bf33cf12b6373bf5ab86072c5f5fa67 (patch) | |
| tree | c8cc9c2ffedd907201b69e06f3f3f53347a76d00 | |
| parent | 9ab4414aefb379c202dee59a657da52e73075dc7 (diff) | |
| download | opencode-3c7b229d8bf33cf12b6373bf5ab86072c5f5fa67.tar.gz opencode-3c7b229d8bf33cf12b6373bf5ab86072c5f5fa67.zip | |
fix: allow `tool.execute.after` hook to modify MCP tool output (#3381)
| -rw-r--r-- | packages/opencode/src/session/prompt.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts index b49b22a52..ee8e36775 100644 --- a/packages/opencode/src/session/prompt.ts +++ b/packages/opencode/src/session/prompt.ts @@ -588,10 +588,7 @@ export namespace SessionPrompt { }, ) const result = await execute(args, opts) - const output = result.content - .filter((x: any) => x.type === "text") - .map((x: any) => x.text) - .join("\n\n") + await Plugin.trigger( "tool.execute.after", { @@ -602,6 +599,11 @@ export namespace SessionPrompt { result, ) + const output = result.content + .filter((x: any) => x.type === "text") + .map((x: any) => x.text) + .join("\n\n") + return { title: "", metadata: {}, |
