gemini-cli - 💡(How to fix) Fix gemini stuck in thinking loop for hours [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26116Fetched 2026-04-29 06:35:44
View on GitHub
Comments
2
Participants
3
Timeline
3
Reactions
2
Timeline (top)
commented ×2labeled ×1
RAW_BUFFERClick to expand / collapse

What happened?

its cli is thinking and thinking and loop donot breaks event it took 2 hours for completing a task which was just be done in 2 minutes in previous version, its started happening in this latest version. it also sometimes in thinking loop mode even after completing task.

What did you expect to happen?

it should think but not struck in loop

Client information

  • CLI Version: 0.39.1
  • Git Commit: 4d73f3413
  • Session ID: 5c371107-417e-485d-8c8c-d6f0bf5c8b59
  • Operating System: win32 v22.20.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-3-flash-preview
  • Auth Type: oauth-personal
  • Memory Usage: 292.0 MB
  • Terminal Name: Unknown
  • Terminal Background: Unknown
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The issue might be resolved by investigating and optimizing the CLI's task execution loop to prevent it from getting stuck.

Guidance

  • Review the changes introduced in the latest version (0.39.1) to identify potential causes for the loop issue.
  • Check for any resource-intensive operations or infinite loops in the task execution code.
  • Verify if the issue is specific to the gemini-3-flash-preview model version or if it occurs with other models as well.
  • Consider adding logging or debugging statements to track the CLI's progress and identify where it gets stuck.

Notes

The issue seems to be specific to the latest version (0.39.1), and the cause is unclear without more information about the changes introduced in this version.

Recommendation

Apply workaround: Investigate and optimize the CLI's task execution loop to prevent it from getting stuck, as the root cause is unclear and no fixed version is mentioned.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

gemini-cli - 💡(How to fix) Fix gemini stuck in thinking loop for hours [2 comments, 3 participants]