gstack's Codex hooks keep working with unusual folder paths and after uninstall (GST-3197) (#4528)

gstack's Codex hooks no longer block every prompt when your Codex
folder's path has a `(` or `&`, and uninstall keeps your own Codex hooks
trusted.

Why: both broke Codex sessions; setup also now matches Codex's hook
rules, and the /review checklist on Codex reads shell commands more
carefully.

Nothing to do: plain paths keep the exact hook command they had, so
Codex asks for no new trust.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=red-team
Review-Finding: lib/codex-rollout.ts:217:functional-contract reader=qa
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-19 15:42:21 +00:00
1 parent bd449234aa
commit 9610ba43db
11 files changed
+557 -50

No files matched your search

+5 -1
View File
@@ -3188,9 +3188,13 @@ create_codex_runtime_root() {
_link_or_copy "$gstack_dir/lib" "$codex_gstack/lib"
fi
# Codex hook shims: ${CODEX_HOME}/hooks.json names this stable path (GST-3172).
# They import the Claude Code hooks beside them (../../claude/hooks), which
# a symlink reaches through the checkout but a Windows copy does not, so the
# Claude hooks come along too; without them all three shims fail open there.
if [ -d "$gstack_dir/hosts/codex/hooks" ]; then
mkdir -p "$codex_gstack/hosts/codex"
mkdir -p "$codex_gstack/hosts/codex" "$codex_gstack/hosts/claude"
_link_or_copy "$gstack_dir/hosts/codex/hooks" "$codex_gstack/hosts/codex/hooks"
_link_or_copy "$gstack_dir/hosts/claude/hooks" "$codex_gstack/hosts/claude/hooks"
fi
if [ -d "$gstack_dir/browse/dist" ]; then
_link_or_copy "$gstack_dir/browse/dist" "$codex_gstack/browse/dist"