Skip to content

Several tools pass shell syntax to run() which uses execFileSync #89

Description

@TerminalGravity

Bug

run() in src/lib/git.ts uses execFileSync (no shell). Several tools pass strings with shell operators (||, &&, 2>/dev/null, |) that get split on whitespace and passed as literal git arguments, silently failing.

Fixed in #88: what-changed.ts, checkpoint.ts

Still affected:

  • token-audit.ts — uses wc -l < ..., tail -c via run()
  • verify-completion.ts — uses npx tsc --noEmit 2>&1 | tail via run()
  • enrich-agent-task.ts — uses git ls-files | head | grep via run()
  • scope-work.ts — uses git ls-files | head | grep via run()
  • session-handoff.ts — uses command -v via run()

These need to either:

  1. Use array args with proper fallback logic (like getDiffFiles)
  2. Use a separate execSync with shell: true for non-git commands
  3. Use Node APIs directly (e.g. fs.statSync instead of wc)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions