Repository navigation
Conversation
gstack-codex-probe is sourced into the agent's tool shell, which is zsh
on macOS Claude Code. BASH_SOURCE is empty there, so every
"${BASH_SOURCE[0]%/*}/..." path collapsed to "/..." and model selection
failed with Module not found "/../scripts/resolve-codex-generation-model.ts"
-> CODEX_MODEL invalid -> CODEX_MODE model_unusable, silently skipping
every outside review. The same paths also broke gstack-state-root lookups.
Add _gstack_codex_bin_dir (bash: BASH_SOURCE; zsh: $functions_source;
fallback ~/.claude/skills/gstack/bin) and use it at all five sites, with
a zsh regression test that fails on the old probe with the exact error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Contributor
|
Thanks for this. The Oct 6 fix wave rewrote the fix on branch |
Contributor
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.
Why (in your own words)
On macOS, Claude Code's tool shell is zsh, and the review skills
source bin/gstack-codex-probeinto it. zsh leavesBASH_SOURCEempty, so every"${BASH_SOURCE[0]%/*}/…"path in the probe collapses to"/…". Model selection then dies withModule not found "/../scripts/resolve-codex-generation-model.ts", printsCODEX_MODEL: invalid, and reportsCODEX_MODE: model_unusable. Every /plan-eng-review (and other outside-voice) run skips Codex, and the message points at the model config, which was fine. The threegstack-state-root.shlookups fail silently the same way. This adds a_gstack_codex_bin_dirhelper that resolves the probe's own directory in bash (BASH_SOURCE) and zsh ($functions_source), with a~/.claude/skills/gstack/binfallback, and uses it at all five sites.Live evidence
Before, the /plan-eng-review preflight run from Claude Code's zsh tool shell on macOS 26:
Root cause, shown directly:
After, the same preflight from the same zsh shell:
Then the skill's exact
codex execblock from zsh with a trivial prompt returnedexit=0and the expectedRecommendation:line.The helper resolves the real directory, not the fallback, in both shells (probe copied to an unrelated dir):
New test
selection works when the probe is sourced from zsh: on the old probe it fails with the exact production error (Module not found "/../scripts/resolve-codex-generation-model.ts"); with the fix it passes. The fixture HOME has no gstack install, so the fallback path cannot pass it.Scope
bin/gstack-codex-probe(new_gstack_codex_bin_dir, 5 call sites),test/codex-model-probe.test.ts(+1 zsh test, skipped when zsh is absent).codex execfrom Claude Code's zsh tool shell (macOS 26, zsh 5.9, bun 1.3.13);bun test test/codex-model-probe.test.ts test/codex-hardening.test.ts→ 91 pass, 3 fail. The 3 failures are the B1 Linux-sandbox cases, and they fail identically on unpatchedmainon macOS.bun run typecheck:test→ "none new".$functions_sourceneeds 5.4+; older zsh falls back to~/.claude/skills/gstack/bin), or the fullbun run testsuite.Liveness proof (required for external contributors)
TODO (@bezdekt): attach the live
GSTACK PRscreenshot before marking ready. This draft was prepared by Claude Code on my behalf.Checklist
GSTACK PRtyped live into a real surface) or PR author is @garrytan (owner exemption)🤖 Generated with Claude Code