fix: use shell() for commands requiring pipes/redirects, fix run() misuse across 11 tools#300
Open
TerminalGravity wants to merge 1 commit intomainfrom
Open
fix: use shell() for commands requiring pipes/redirects, fix run() misuse across 11 tools#300TerminalGravity wants to merge 1 commit intomainfrom
TerminalGravity wants to merge 1 commit intomainfrom
Conversation
…suse
Multiple tools were passing shell syntax (pipes, redirects, ||, 2>/dev/null)
and non-git commands (find, wc, cat, head) to the git run() function, which
uses execFileSync('git', args) — no shell interpretation. This caused:
- Shell operators becoming literal git arguments (silent failures)
- Non-git commands being prepended with 'git' (e.g., 'git cat package.json')
- Commands with 'git' prefix getting doubled ('git git diff ...')
Added shell() helper in lib/git.ts for commands that need shell features.
Fixed 11 tool files to use the correct execution method:
- Simple git commands → run(['arg1', 'arg2']) (array form, safe)
- Complex pipelines / non-git commands → shell('cmd | cmd2')
- File reads → fs.readFileSync (verify-completion.ts)
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.
Problem
Multiple tools were passing shell syntax (pipes, redirects,
||,2>/dev/null) and non-git commands (find,wc,cat,head) to the gitrun()function, which usesexecFileSync('git', args)— no shell interpretation.This caused:
git(e.g.,git cat package.json)gitgetting doubled (git git diff ...)Affected tools: audit-workspace, checkpoint, clarify-intent, enrich-agent-task, sequence-tasks, session-handoff, sharpen-followup, token-audit, verify-completion, what-changed (11 files)
Fix
shell()helper inlib/git.tsfor commands needing shell features (pipes, redirects, non-git commands)run(['arg1', 'arg2'])(array form, safe)shell('cmd | cmd2')fs.readFileSync(verify-completion.ts)Verification
tsc --noEmit: cleanvitest run: 43/43 tests passeslint: no new warnings