core-agent-ide/codex-cli/src/utils/agent
Brayden Moon 8dd1125681
fix: command pipe execution by improving shell detection (#437)
## Description
This PR fixes Issue #421 where commands with pipes (e.g., `grep -R ...
-n | head -n 20`) were failing to execute properly after PR #391 was
merged.

## Changes
- Modified the `requiresShell` function to only enable shell mode when
the command is a single string containing shell operators
- Added logic to handle the case where shell operators are passed as
separate arguments
- Added comprehensive tests to verify the fix

## Root Cause
The issue was that the `requiresShell` function was detecting shell
operators like `|` even when they were passed as separate arguments,
which caused the command to be executed with `shell: true`
unnecessarily. This was causing syntax errors when running commands with
pipes.

## Testing
- Added unit tests to verify the fix
- Manually tested with real commands using pipes
- Ensured all existing tests pass

Fixes #421
2025-04-20 21:11:19 -07:00
..
sandbox fix: remove unnecessary isLoggingEnabled() checks (#420) 2025-04-20 09:58:06 -07:00
agent-loop.ts feat: support multiple providers via Responses-Completion transformation (#247) 2025-04-20 20:59:34 -07:00
apply-patch.ts chore: consolidate patch prefix constants in apply‑patch.ts (#274) 2025-04-17 17:00:30 -07:00
exec.ts fix: command pipe execution by improving shell detection (#437) 2025-04-20 21:11:19 -07:00
handle-exec-command.ts fix: remove unnecessary isLoggingEnabled() checks (#420) 2025-04-20 09:58:06 -07:00
log.ts fix: remove unnecessary isLoggingEnabled() checks (#420) 2025-04-20 09:58:06 -07:00
parse-apply-patch.ts Initial commit 2025-04-16 12:56:08 -04:00
platform-commands.ts fix: remove unnecessary isLoggingEnabled() checks (#420) 2025-04-20 09:58:06 -07:00
review.ts feat: shell command explanation option (#173) 2025-04-17 13:28:58 -07:00