fix: address Copilot review feedback on PR #32

- tests/run.sh: check source return code, report failures
- tests/regression/run.sh: use mktemp + trap cleanup instead of fixed /tmp paths
- tests/regression/run.sh: include .mcp.json in regression comparison
- tests/regression/take-snapshot.sh: use --platform flag instead of stale scripted input
- adapters/opencode/templates/plugin-stub.js.tmpl: include stdout in hook block error message
This commit is contained in:
nunziati
2026-04-10 20:26:50 +00:00
parent 0c44bc217d
commit 8d71875c2b
4 changed files with 31 additions and 29 deletions

View File

@@ -78,10 +78,11 @@ module.exports = async function mbifcHooksPlugin({ app, client }) {
const scriptAbs = path.isAbsolute(h.script)
? h.script
: path.join(__dirname, h.script);
const { exitCode, stderr } = await runBashHook(scriptAbs, payload);
const { exitCode, stdout, stderr } = await runBashHook(scriptAbs, payload);
if (exitCode === 2) {
// Documented opencode block mechanism for tool.execute.before
throw new Error(`[${h.name}] blocked: ${stderr.trim() || "exit 2"}`);
const reason = stdout.trim() || stderr.trim() || "exit 2";
throw new Error(`[${h.name}] blocked: ${reason}`);
}
}
};