mirror of
https://github.com/gnekt/My-Brain-Is-Full-Crew.git
synced 2026-09-07 02:24:31 +00:00
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:
@@ -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}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user