fix(plugin): actually inject post-tool-use hook output into response

runHook() return value was being discarded. The hook was called but its
additionalContext was never appended to output.response, so reminders
never appeared in the model's tool result.
This commit is contained in:
Brydon DeWitt 2026-05-22 23:48:03 -04:00
parent f0d21e9895
commit 2949981e43

View File

@ -280,7 +280,11 @@ export const AgentSupportPlugin: Plugin = async ({ $, directory }) => {
tool_input: input.args ?? {}, tool_input: input.args ?? {},
tool_response: (output.response as string).slice(0, 500), // truncated for hook tool_response: (output.response as string).slice(0, 500), // truncated for hook
}); });
await runHook("post-tool-use.sh", hookInput); const postToolOutput = await runHook("post-tool-use.sh", hookInput);
const postToolContext = parseAdditionalContext(postToolOutput);
if (postToolContext) {
output.response = `${output.response}\n\n${postToolContext}`;
}
} }
}, },