google-gemini / google-gemini/gemini-cli
bug(cli): ShellProcessor ignores abort signal, hung custom command blocks prompt pipeline
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
## What happened?
`packages/cli/src/services/prompt-processors/shellProcessor.ts:171-178` executes every `!{cmd}` injection with a fresh, never-linked `AbortController`, serially:
```ts
const { result } = await ShellExecutionService.execute(
injection.resolvedCommand,
config.getTargetDir(),
() => {},
new AbortController().signal,
...
);
```
User Ctrl+C / caller abort never reaches the child; the `for...of` loop awaits each command with no per-command timeout. One hung custom command blocks the whole prompt pipeline.
## What did you expect to happen?
Thread the caller's `AbortSignal` into `process()`/`CommandContext`, run with per-command timeout, kill on abort, and continue or fail gracefully with a visible message.
## Client information
- Repo `google-gemini/gemini-cli` @ `main` `9c1b0a610`
- Area `packages/cli/src/services/prompt-processors/shellProcessor.ts:155-180`
- Platform: interactive CLI with `!{sleep 60}` custom command
## Login information
N/A — repro: prompt containing hung `!{...}` + Ctrl+C still blocks.
## Anything else we need to know?
Fix direction: accept `AbortSignal` param, `Promise.allSettled` with timeout + abort-kill, test asserting abort terminates child and pipeline continues.
Contributor guide
Research direction
Start with packages/cli/src/services/prompt-processors/shellProcessor.ts:155-180 and trace process(), CommandContext, and ShellExecutionService.execute(). Reproduce the hung !{sleep 60} command with Ctrl+C, then add coverage asserting that abort terminates the child and the prompt pipeline continues or reports a visible failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100