Gemini stalled after completing command.
What happened?
Asked gemini to find an kill a process due to a stalled application, which turned to be successful, however Gemini kept repeating the same 2 verification steps, as if it couldn't see that the process was actually killed. Waited for 30 seconds after the application "died".
What did you expect to happen?
Gemini to finish output before entering new input.
Client information
Gemini
- CLI Version:
0.1.18 - Git Commit:
cd7e60e0 - Operating System:
darwin - Sandbox Environment:
no sandbox - Model Version:
gemini-2.5-pro - Memory Usage:
ℹ Memory is currently empty.
Physical Specifications
- Manufacturer: Apple
- Model Name: MacBook Air
- Model Identifier: Mac15,13
- Model Number: MRYU3LL/A
- Chip: Apple M3
- Total Number of Cores: 8 (4 performance and 4 efficiency)
- Memory: 8 GB
- System Firmware Version: 13822.1.2
- System Version: macOS 26.0 (25A5338b) {Tahoe Developer Beta 6}
- Kernel Version: Darwin 25.0.0
Login information
Oauth, for this session. However, I have used both login options.
Anything else we need to know?
╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > find "ActivePresenter.app" and kill the process. It is stalled and does not show in the dock or │
│ respond to trying to close the window. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I'll find and kill the "ActivePresenter.app" process. I'll use ps aux | grep ActivePresenter.app to get
its PID.
╭────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✔ Shell ps aux | grep 'ActivePresenter.app' │
│ │
│ tylerronek 40916 0.4 0.0 435300128 1792 ?? Ss 8:13AM 0:00.01 bash -c { │
│ ps aux | grep 'ActivePresenter.app'; }; __code=$?; pgrep -g 0 │
│ >/var/folders/xt/qwxlp70x307bxsr1jx576krm0000gn/T/shell_pgrep_2022d150cb24.tmp 2>&1; exit │
│ $__code; │
│ tylerronek 40086 0.0 0.2 43716544 15260 ?? S 8:01AM 3:22.70 │
│ /Applications/ActivePresenter.app/Contents/MacOS/ActivePresenter │
│ tylerronek 40918 0.0 0.0 435299696 1424 ?? S 8:13AM 0:00.00 grep │
│ ActivePresenter.app │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ Okay, PID is 40086. I'm killing it now with kill -9 40086. The "ActivePresenter.app" process will be
terminated.
╭─────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✔ Shell kill -9 40086 (This will forcefully terminate the 'ActivePresenter.app' process.) │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
✦ kill command sent. PID 40086 should be gone. I'll verify with ps aux | grep 'ActivePresenter.app'; it
shouldn't be in the output.
╭────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✔ Shell ps aux | grep 'ActivePresenter.app' │
│ │
│ tylerronek 40961 0.0 0.0 435299840 1424 ?? S 8:14AM 0:00.00 grep │
│ ActivePresenter.app │
│ tylerronek 40959 0.0 0.0 435300288 1792 ?? Ss 8:14AM 0:00.00 bash -c { │
│ ps aux | grep 'ActivePresenter.app'; }; __code=$?; pgrep -g 0 │
│ >/var/folders/xt/qwxlp70x307bxsr1jx576krm0000gn/T/shell_pgrep_060910912168.tmp 2>&1; exit │
│ $__code; │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────╯
ℹ Request cancelled.
╭──────────╮
│ > /bug │
╰──────────╯
ℹ To submit your bug report, please open the following URL in your browser:
https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title=&info=%0A*%20**CLI%
20Version%3A**%200.1.18%0A*%20**Git%20Commit%3A**%20cd7e60e0%0A*%20**Operating%20System%3A**%20darwin%20
v22.18.0%0A*%20**Sandbox%20Environment%3A**%20no%20sandbox%0A*%20**Model%20Version%3A**%20gemini-2.5-pro
%0A*%20**Memory%20Usage%3A**%20149.0%20MB%0A
Hello,
I believe this stalling issue is directly related to Issue #4095, which reports a ✖ missing pgrep output error.
Root Cause Hypothesis:
The missing pgrep output error appears to be a symptom of a race condition in the gemini-cli's process monitoring logic.
Objective Findings from Local Logs:
My analysis of local session logs (checkpoint-*.json files on Linux/Crostini) shows a consistent pattern: the missing pgrep output error occurs immediately after the successful execution (exit code 0) of fast, non-interactive shell commands. Examples of commands that triggered this include mkdir -p, git checkout -b, and cp.
This strongly suggests that the command's process terminates before the CLI's pgrep check is performed. As a result, pgrep correctly finds no process and returns an empty output, which is then flagged as a monitoring error.
Connection to This Stalling Issue (#6050):
If the agent's internal state relies on a successful pgrep check to confirm that a command has completed, this race condition would leave it in a state of uncertainty. The agent could then enter a loop, repeatedly trying to verify the status of a command that has already finished, which matches the stalling behavior described here.
Suggested Fix:
The solution may not be to simply hide the pgrep error, but to make the verification logic more robust. It should gracefully handle this race condition. A successful exit code (0) from a command that is no longer running should be treated as a success, not a monitoring failure.
I hope this analysis helps in addressing the root cause of both issues.
Hi, Thanks for your feedback,
Could you check and let us know if you are still seeing this issue? You seem to be on an old version of Gemini CLI and we've made significant improvements since that time.
Please do let us know if you still run into this and we would be happy to investigate
Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.
It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.
Thank you for your contribution!