Repository navigation
gstack's Codex hooks keep working with unusual folder paths and after uninstall (GST-3197) - #4528
Merged
Merged
Conversation
…ws and after uninstall (GST-3197) Quote hook paths with shell metacharacters, keep your Codex hook groups' trust positions on uninstall, copy the Claude hook code Codex shims import on Windows, and read shell commands more carefully in the Codex /review checklist. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…mes another file, read Rust matcher syntax, and say plainly that Windows Codex can't start the hooks yet Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A read that names more than one file no longer loses its load when another file fails; the exit-status rule applies only to a one-file read. Review-Finding: p1/specialist-batched#1 reader=red-team Review-Finding: lib/codex-rollout.ts:217:functional-contract reader=qa Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… can't run the hooks yet Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
|
Flaky, not this change: |
Merged
capy-ai Bot
added a commit
that referenced
this pull request
Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494) - /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496) - On Capy, /ship no longer edits or comments on pull requests as you. (#4518) - The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513) - The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525) - The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491) - gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528) - Uninstalling gstack keeps your own Codex hooks trusted. (#4528) - Codex hook setup matches Codex more closely. (#4528) - On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528) - /review's checklist on Codex reads shell commands more carefully. (#4528) - On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512) - On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522) - On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523) - On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524) - /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526) - On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510) - gstack knows when Codex is running unattended. (#4510) - Codex reviewers start with a clean context. (#4510) - Docs no longer say Codex has no hook support. (#4510) - A command whose output was cut off no longer counts as a finished read. (#4492) - A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516) - Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505) - /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497) - Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530) - Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532) - gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503) - `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483) - The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515) - When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515) - When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515) - The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527) - /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527) - Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527) - /ship can now review results PRs that publish raw session data. (#4511) - /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507) - A second review round no longer reports done when nothing was reviewed. (#4520) - The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506) - gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502) - A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519) - `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529) - Five small ship-tool fixes. (#4529) - A ruling the owner gives while a `/ship` run is open can be relayed. (#4529) - /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533) - /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504) - When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
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.
What changed
bin/gstack-settings-hook): a hook command whose path holds any character outside[A-Za-z0-9_@%+=:,./-](or non-ASCII) is quoted for Claude Code and Codex. Before,(or&made a shell syntax error, which Codex reads as "block".{"hooks": []}where gstack's group sat, so groups after it keep the index Codex trusts them by. When your handler is inside gstack's group, gstack leaves the file alone and names the one handler to delete.gstack-uninstallprints a warning when gstack's Codex hooks are still in place.description: nullis accepted, MCP hook input carrying a null is refused,rollbackwon't restore a backup Codex would skip, a gstack hook already declared inconfig.tomlunder any matcher that covers Bash is caught (Rust's leading(?i)/(?m)/(?s),\Aand\zare translated; anything JS still can't compile is refused), and trust status keys on the same path Codex uses whenCODEX_HOMEis a symlink.hosts/claude/hooksinto Codex's gstack folder, because the three Codex shims import it. Native Windows Codex starts hooks throughcmd.exe, which can't run these Bash scripts, so this alone doesn't make them run there (see Known limits).lib/codex-rollout.ts): quote-aware command splitting; every read-error line still drops the read unless it provably names another file (another read's path, longer path winning, or a path that is no SKILL.md); PowerShell's "Cannot find path" counts as a failed read, a last command that reads one file and exits non-zero isn't a load, a||fallback isn't a load, and an image-only user message starts a new turn.docs/uninstall.md(delete a trailing group only when it holds nothing but gstack's handlers); a changelog fragment.Tests
test/codex-hooks.test.ts,test/codex-hooks-setup.test.ts(Windows copy, uninstall slot and warning),test/skill-contract-codex.test.tsandtest/codex-hooks-real-codex.test.ts(real codex-cli 0.170hooks/listshows your group keeps its trusted key after gstack's is removed, and the hooks run from ahooks(2)path).bin/,setupandlib/codex-rollout.ts, and passes here; typecheck clean.Known limits
&&chain (cd /nope && cat X && echo) still counts as a load, and so does a quotedechothat containscat …SKILL.md.timeout,statusMessage) stay stricter than Codex's own parser, except thatrollbackaccepts a backup with"timeout": 1.0, which Codex rejects; such a backup is the user's own earlier file.cmd.exe, so gstack's Bash hooks don't start there.pipefailis judged by the call's exit status.config.toml(\pLwithout the u flag,[[:alpha:]]) reads as no clash, so a gstack hook also declared there under such a matcher would run twice.hooks.jsonround-trips it through JSON, so an integer above 2^53 in a hook's input would change; this already held for every write before this PR.Documentation
Status: updated. One stale Codex hooks paragraph corrected; no blockers.
Scope: base 18e24a2..1c91b66 on
codex-hooks-hardening(10 committed files, nothing staged, unstaged or new). I audited docs that mention Codexhooks.jsonorhosts/codex/hooks:docs/skill-routing-and-contracts.md,docs/uninstall.md,docs/hosts.mdandchangelog.d/codex-hooks-hardening.md.Documentation health:
docs/skill-routing-and-contracts.md: Updated. Uninstall and--no-teamnow leave an empty group so your own hooks keep their Codex trust positions; gstack refuses only when your handler sits inside gstack's group. Added that native Windows Codex can't run the hooks yet.docs/uninstall.md: Current (updated on the branch).docs/hosts.md: Current.changelog.d/codex-hooks-hardening.md: Current (reviewed only).Coverage debt: none. The changed hook behavior is covered by the reference docs and the uninstall how-to. Path quoting is described in the changelog only; it's internal hardening with no user setting.
Diagram drift: none.
Agent notes
Bug fixes (no plan review), items 1-9 of the GST-3197 brief. Decision trail: reports/GSTA-651-decisions.tsv rows 13-38 in the controller drive. Paid evals: none for this PR (Captain's ruling: the release gate covers the paid tier at the cut).
Captain grants (GStack Minder, GSTA-36, 2026-11-19)
Pre-Landing Review: 3 issues — 2 fixed (granted), 1 skipped as a named risk, 0 deferred; fix-check: 2 notes; adversarial-native: 6 notes, none blocking.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=8 fixed=2 scope=frozen ledgers_read=3 fix_checks=1 dispatches=1 est_input_tokens=15451
Gate edits: none detected (8 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Exploratory QA: pass on the fixed tree (remove-source leaves an empty group and quotes a path with a space and parenthesis; the multi-file read replay now loads). The first run at 21958b5 failed probe 002, which the granted fix closed.
Noted, not fixed (below the floor): non-string matcher in config.toml throws instead of refusing; a placeholder from an earlier run is never trimmed once it ends up last; uninstall's 2>&1 hides prune-stale warnings on success; namesOneFile counts an option's value as a file and misreads bash -lc "cat X" and cat < X (a silent non-zero exit then counts as a load).
CI: Free Tests 44553074910 carried bun run test (1710 files) at 4b5de77; codex-hooks lane 76 pass; requires-remote lanes cleared from 44553074910, 44553074531 and 44553074636.
Approvals
Approved: yes (record r-40bfcc860571). The full approval record stays private.
Plan: exempt: bug fix
Plan check: exempt bug fix