Files
gstack/.github/workflows/codex-hooks.yml
T
Garry Tanandcapy-ai[bot] 944b41e24d Codex gets gstack's skill routing hint and destructive-command check (GST-3172) (#4512)
`./setup --host codex` now adds gstack's skill-routing hint and
destructive-command check to Codex's `~/.codex/hooks.json`, next to your
own hooks, so Codex users get the same guardrails Claude Code users
have.

Codex runs a hook only after you trust it, so nothing fires until you
accept gstack's hooks at Codex's startup prompt or in `/hooks`;
`gstack-doctor` shows whether you have.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
2026-11-19 11:09:11 +00:00

46 lines
1.6 KiB
YAML

name: Codex hooks
# A real Codex CLI reads the hooks.json gstack writes (GST-3172). Codex 0.170
# skips the whole file when it holds a key it does not know, which would also
# switch off the user's own hooks, so the free check runs against the real
# binary: test/codex-hooks-real-codex.test.ts points Codex at a closed local
# port, so its hooks fire and no model is called. Secretless: no API key, and
# GSTACK_REQUIRE_CODEX=1 makes a missing codex fail instead of skipping.
on:
pull_request:
branches: [main]
paths:
- bin/gstack-settings-hook
- hosts/codex/hooks/**
- hosts/claude/hooks/skill-route-hook.ts
- hosts/claude/hooks/destructive-guard-hook.ts
- lib/skill-route.ts
- test/codex-hooks-real-codex.test.ts
- .github/workflows/codex-hooks.yml
workflow_dispatch:
permissions:
contents: read
jobs:
real-codex:
name: Real Codex reads gstack's hooks.json
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.4.2
- name: Install dependencies
run: bun install --frozen-lockfile --ignore-scripts
- name: Install the Codex CLI the hooks are tested on
run: npm install -g @openai/codex@0.170.0 && codex --version
- name: Codex runs the merged hooks.json (no model call)
env:
GSTACK_REQUIRE_CODEX: "1"
run: bun test test/codex-hooks-real-codex.test.ts