Skip to content

bug(cli): ShellProcessor ignores abort signal, hung custom command blocks prompt pipeline #29314

Description

@aniruddhaadak80

What happened?

packages/cli/src/services/prompt-processors/shellProcessor.ts:171-178 executes every !{cmd} injection with a fresh, never-linked AbortController, serially:

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.

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

    area/coreIssues related to User Interface, OS Support, Core Functionalityeffort/medium2-3 days: UI state, async flow, cross-component refactorskind/bugpriority/p1Important and should be addressed in the near term.status/bot-triagedstatus/need-information

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions