Repository navigation
fix(codex): keep the Stop hook out of user-level Codex config; report a read-only .codex - #169
Open
ChronodeAi wants to merge 1 commit into
Open
ChronodeAi wants to merge 1 commit into
ChronodeAi wants to merge 1 commit into
Conversation
… a read-only .codex A vault at $HOME made <root>/.codex/hooks.json Codex's user-level hooks file, so the stop gate ran in every Codex session and, via walk-up vault discovery, could force-continue unrelated sessions while a home-vault run was mid-pipeline. Skip the hook when the project's .codex/ is $CODEX_HOME (default ~/.codex). The first-run bootstrap inside a Codex session crashed with EROFS because the workspace-write sandbox keeps .codex/ read-only; report the hook as NOT installed with the command to run outside the sandbox, and tell the orchestrator to retry once with escalation.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two problems in the Codex Stop hook install, both found while deploying
--target codexon a machine whose home directory is already a hyperresearch project. In that setup the Claude-side bootstrap had already run from~.1. Home-directory vaults turned the stop gate into a user-level hook.
_install_codex_stop_hookwrites<vault_root>/.codex/hooks.json. Whenvault_rootis~, that path is Codex's user-level hooks file, so the gate ran in every Codex session.run stop-gatefinds a vault by walking up from the session's directory. So while a home-vault run was mid-pipeline (including a run driven from Claude Code), unrelated Codex sessions anywhere under~were force-continued with "continue the hyperresearch run" prompts. The docstring already says "never ~/.codex", and the global install already avoids it. The hook is now skipped with a "NOT installed" note whenever the project's.codex/resolves to$CODEX_HOME(default~/.codex).2. The first-run bootstrap crashed inside the Codex sandbox. The workspace-write sandbox keeps
.codex/read-only, even when the directory does not exist yet. Soinstall --steps-only . --target codex, run by the entry skill's step 0, wrote the step files and then died withOSError: [Errno 30] Read-only file system. Reproduced withcodex sandbox -c sandbox_mode="workspace-write" -- hyperresearch install --steps-only . --target codex. It now returns "NOT installed" together with the command to run outside the sandbox, the same way it already handles an unparseablehooks.json. The Codex entry skill tells the orchestrator to re-run that one command once with escalated permissions, and to carry on without the hook if escalation is unavailable (codex exec).Tests: two regression tests. One sets the home directory through both
CODEX_HOMEandHOME; the other makes.codexread-only. Both fail before this change and pass after. Full suite: 1722 passed.