Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion plugins/codex/scripts/session-lifecycle-hook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ export const SESSION_ID_ENV = "CODEX_COMPANION_SESSION_ID";
const PLUGIN_DATA_ENV = "CLAUDE_PLUGIN_DATA";

function readHookInput() {
const raw = fs.readFileSync(0, "utf8").trim();
let raw;
try {
raw = fs.readFileSync(0, "utf8").trim();
} catch (err) {
if (err.code === "EAGAIN" || err.code === "EWOULDBLOCK") {
return {};
}
throw err;
}
if (!raw) {
return {};
}
Expand Down
10 changes: 9 additions & 1 deletion plugins/codex/scripts/stop-review-gate-hook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ const ROOT_DIR = path.resolve(SCRIPT_DIR, "..");
const STOP_REVIEW_TASK_MARKER = "Run a stop-gate review of the previous Claude turn.";

function readHookInput() {
const raw = fs.readFileSync(0, "utf8").trim();
let raw;
try {
raw = fs.readFileSync(0, "utf8").trim();
} catch (err) {
if (err.code === "EAGAIN" || err.code === "EWOULDBLOCK") {
return {};
}
throw err;
}
if (!raw) {
return {};
}
Expand Down