Files
gstack/hosts/codex/hooks/codex-skill-contract-stop-hook
T
Garry Tanandcapy-ai[bot] b0f865c00c Codex now holds /review to its checklist before a session can end (GST-3173) (#4522)
On Codex, gstack's /review can no longer end a session with a required
step skipped: the end-of-session check reads Codex's own session log and
sends the agent back to finish, as it already does on Claude Code.

Why: Codex users got routing and the destructive-command check in #4512,
but not the /review checklist, so a review could stop after the diff
read with no second-model pass.

To use it: run `./setup` again and trust the new hook in Codex
(`/hooks`); turn it off with `GSTACK_SKILL_CONTRACTS=off`.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/specialist-batched#2 reader=testing
2026-11-19 12:44:06 +00:00

12 lines
745 B
Bash
Executable File

#!/usr/bin/env bash
# Bash shim for Codex: Codex runs hook commands through a login shell, so this
# wrapper makes the TypeScript hook executable via bun. ${CODEX_HOME}/hooks.json
# references it through the Codex runtime root (${CODEX_HOME}/skills/gstack,
# whose hosts/codex/hooks links here), so pwd -P finds the checkout.
#
# FAIL-OPEN: every failure path — bun missing, script crash — still exits 0.
GSTACK_BUN_CONFIG=/dev/null; case "${OSTYPE:-}" in msys*|cygwin*) if command -v cygpath >/dev/null 2>&1; then GSTACK_BUN_CONFIG=NUL; fi ;; esac
HERE="$(cd "$(dirname "$0")" && pwd -P)" || exit 0
GSTACK_HOOK_HOST=codex bun --no-env-file --config="${GSTACK_BUN_CONFIG:-/dev/null}" "$HERE/codex-skill-contract-stop-hook.ts" || true
exit 0