Skip to content

Shell syntax passed to run() across multiple tools #302

Description

@TerminalGravity

Bug

run() in src/lib/git.ts uses execFileSync (no shell), but many tools pass strings containing shell syntax like 2>/dev/null, ||, pipes, and < file redirects. These get split on whitespace and passed as literal git args, causing silent failures.

Affected files

  • src/tools/token-audit.ts2>/dev/null, wc -l < file
  • src/tools/enrich-agent-task.tsgrep pipes, 2>/dev/null
  • src/tools/clarify-intent.tspnpm tsc --noEmit 2>&1 | grep, find ... 2>/dev/null
  • src/tools/audit-workspace.ts2>/dev/null, find ... | wc -l
  • src/tools/sharpen-followup.ts2>/dev/null
  • src/tools/session-handoff.tscommand -v ... 2>/dev/null, || echo
  • src/tools/sequence-tasks.tsgit ls-files 2>/dev/null | head
  • src/tools/checkpoint.tsgit reset HEAD 2>/dev/null
  • src/tools/scan-sessions.ts — various

Fix

Each call needs to be converted to use array args with run(), and non-git commands (wc, find, grep) need their own execFileSync calls or Node.js equivalents.

PR #301 fixes what-changed.ts as a start.

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