From 1a20eb9977dc03e43581e263ebfcbc9eb8d1a8ce Mon Sep 17 00:00:00 2001 From: aramfachan Date: Sat, 19 Sep 2026 00:11:54 -0300 Subject: [PATCH 1/2] Make the prebuild step work on Windows npm runs package scripts with cmd.exe on Windows, where `mkdir -p` is not a flag: `npm run build` created a directory literally named "-p" next to the real one. Create the generated-types directory with `node -e "require('node:fs').mkdirSync(..., {recursive: true})"`, which behaves the same under cmd.exe and POSIX shells. Verified on Windows 11 (cmd.exe as npm script shell, Node 24.18, codex-cli 0.155.0-alpha): `npm run build` generates the app-server types and `tsc -p tsconfig.app-server.json` succeeds, with no stray "-p" directory. Also verified under Git Bash. Co-Authored-By: Claude Opus 5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b1d984d1a..320cf0950 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "scripts": { "bump-version": "node scripts/bump-version.mjs", "check-version": "node scripts/bump-version.mjs --check", - "prebuild": "mkdir -p plugins/codex/.generated/app-server-types && codex app-server generate-ts --out plugins/codex/.generated/app-server-types", + "prebuild": "node -e \"require('node:fs').mkdirSync('plugins/codex/.generated/app-server-types',{recursive:true})\" && codex app-server generate-ts --out plugins/codex/.generated/app-server-types", "build": "tsc -p tsconfig.app-server.json", "test": "node --test tests/*.test.mjs" }, From 3eb5a5484af4f52dd21bfa4fefadb0876814a7cc Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 20 Sep 2026 12:29:36 +0000 Subject: [PATCH 2/2] docs: the SessionEnd hook has 30 seconds, not 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment above the interrupt budgets named the wrong hook's timeout: hooks.json gives SessionStart 5 seconds and SessionEnd 30. It is the comment someone reads before touching those budgets — now including CODEX_TURN_INTERRUPT_BUDGET_MS, which exists to raise one of them — so starting from the wrong ceiling is exactly the wrong place to start. Also records #770 in the imports table. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01UXfvnjSC72HsM6EEPVt2Tg --- README.md | 1 + plugins/codex/scripts/session-lifecycle-hook.mjs | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff5e22c7f..b6229b1b9 100644 --- a/README.md +++ b/README.md @@ -422,6 +422,7 @@ Broker and background-job lifecycle: | [#728](https://github.com/openai/codex-plugin-cc/pull/728) | a job whose worker died no longer reads as "running" forever; `/codex:status` reconciles the record against the live process | | [#725](https://github.com/openai/codex-plugin-cc/pull/725) | nothing is spawned through the user's shell on Windows, where MSYS path conversion mangled switches like `taskkill /PID` and left background workers unkillable under Git Bash (this supersedes [#735](https://github.com/openai/codex-plugin-cc/pull/735)) | | [#656](https://github.com/openai/codex-plugin-cc/pull/656) | `/codex:cancel` exits non-zero when neither the turn interrupt nor the worker kill confirmed the job stopped, instead of reporting a cancellation nothing proved | +| [#770](https://github.com/openai/codex-plugin-cc/pull/770) | `npm run build` works on Windows: npm runs scripts through cmd.exe, where `mkdir -p` made a stray `-p` directory and then failed every build after the first | Commands and flags: diff --git a/plugins/codex/scripts/session-lifecycle-hook.mjs b/plugins/codex/scripts/session-lifecycle-hook.mjs index c491494d4..0e658b848 100644 --- a/plugins/codex/scripts/session-lifecycle-hook.mjs +++ b/plugins/codex/scripts/session-lifecycle-hook.mjs @@ -23,11 +23,12 @@ import { resolveWorkspaceRoot } from "./lib/workspace.mjs"; export const SESSION_ID_ENV = "CODEX_COMPANION_SESSION_ID"; const PLUGIN_DATA_ENV = "CLAUDE_PLUGIN_DATA"; -// The SessionEnd hook runs under a 5-second timeout (hooks.json). The -// budgets below must sum comfortably under it: brokered turn interrupts -// (identity waits are capped per job and reserve room for the interrupt -// RPCs themselves), then a short exit grace for killed workers, then the -// shutdown exchange with its one retry. +// The SessionEnd hook runs under a 30-second timeout (hooks.json; SessionStart is the 5-second +// one). The budgets below must sum comfortably under it: brokered turn interrupts (identity waits +// are capped per job and reserve room for the interrupt RPCs themselves), then a short exit grace +// for killed workers, then the shutdown exchange with its one retry. The default interrupt budget +// is deliberately far below the hook timeout — the hook must return long before Claude Code stops +// waiting — and CODEX_TURN_INTERRUPT_BUDGET_MS raises it for a workspace with many active jobs. const TURN_INTERRUPT_BUDGET_MS = turnInterruptBudgetMs(); const TURN_IDENTITY_WAIT_MS = 500; const TURN_INTERRUPT_RESERVE_MS = 1000;