fix(gstack-paths): add --get <key> so /codex skips eval-tilde footgun#1496
Open
0xDevNinja wants to merge 1 commit into
Open
fix(gstack-paths): add --get <key> so /codex skips eval-tilde footgun#14960xDevNinja wants to merge 1 commit into
0xDevNinja wants to merge 1 commit into
Conversation
- Pattern 2 in garrytan#1329: `eval "$(~/.claude/skills/gstack/bin/gstack-paths)"` trips Claude Code's bash AST parser ("Unhandled node type: string") because of tilde inside $() inside double-quoted eval arg. Forces manual approval on every /codex. - `gstack-paths --get state-root|plan-root|tmp-root` prints one path, no `KEY=` prefix. Callers use `PLAN_ROOT=$(gstack-paths --get plan-root)`. - Bare invocation unchanged (KEY=VALUE form), so unmigrated skills keep working. - `codex/SKILL.md.tmpl` Step 0.6 switched + regenerated SKILL.md. - Patterns 1/3/4 + other skills using the eval form out of scope; one-at-a-time migration. Refs garrytan#1329
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.
Summary
Pattern 2 from Multiple Claude Code security hook triggers in
/codexand/autoplanskill templates #1329:eval "$(~/.claude/skills/gstack/bin/gstack-paths)"trips Claude Code's PreToolUse bash AST parser (Unhandled node type: string) because of tilde inside$()inside a double-quoted eval arg./codexforces a manual approval on every run as a result.gstack-paths --get state-root|plan-root|tmp-rootprints a single path with noKEY=prefix, so callers can use:Bare invocation stays backward-compatible (
KEY=VALUEform). No compat break for skills that haven't been migrated yet.codex/SKILL.md.tmplStep 0.6 switched to--get.codex/SKILL.mdregenerated viabun run gen:skill-docs.Refs #1329.
Scope
Fix narrow on purpose — Pattern 2 in
/codexonly. Patterns 1 / 3 / 4 each need their own design (Pattern 1 = splitgstack-codex-probefunctions into binaries; Pattern 3 = subshell orcodex -C; Pattern 4 = extract inline Python togstack-codex-jsonl-parser). Bundling all four into one PR would balloon the diff across multiple binaries + skill surfaces.Other skills that still use
eval "$(gstack-paths)"(learn,freeze,investigate,context-restore,office-hours,context-save,guard,unfreeze,plan-tune) are unchanged here — migration can land one skill at a time on top of this PR with no compat risk because bare invocation still works.Tests
7 new cases in
test/gstack-paths.test.ts:--get state-root/plan-root/tmp-rooteach return the single resolved path, noKEY=prefix.GSTACK_PLAN_DIR,TMPDIR, etc.).--get bogusexits 1 withunknown key.--getwithout a key exits 1 with--get requires a key.--bogustop-level flag exits 1 withunknown argument.GSTACK_STATE_ROOT=/PLAN_ROOT=/TMP_ROOT=(backward-compat guard).Verification
Manual: