Gemini 3.1 PRO gets stuck

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When developing on Claude Opus 4.7 max effort 1m token context there was congestion that had me switching the model to Gemini 3.1 pro on request where context usage was at 800 000 tokens. After the switch, I left my laptop at the office because Opus already had completed like 20 of the 27 tasks so I thought it’d complete all the steps and end the task.

When I came back to the office 12 hours later - Gemini was still running. I had left it in plan mode, and for 12 hours it had been going in a loop: planning → thinking → asking to switch to agent mode (denied on timeout) → planning some more → thinking → asking …

As an engineer I expect if a a) plan is complete b) request to switch to agent mode is denied => the model ends the task and waits for a new user prompt.

Gemini spent 12 hours and all of my Ultra plan tokens in this dead loop.. :frowning:

Steps to Reproduce

Steps to reproduce: Run Opus 4.7 max 1 million → fill the context window → switch to Gemini 3.1 pro max → close your laptop

Expected Behavior

As an engineer I’d expect the agent to either a) complete the tasks or b) stop ‘thinking’ in a dead loop and just complete the plan step.

Operating System

MacOS

Version Information

Macbook pro m4 pro Tahoe 26.3.1 (25D2128)
Version: 2.7.0-pre.96.patch.0
VSCode Version: 1.105.1
Commit: c6712eb06f4e47a06a31f4d7adf484bfcbf61cc0
Date: 2026-03-19T17:53:17.088Z (1 mo ago)
Build Type: Stable
Release Track: Nightly
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

For AI issues: which model did you use?

Claude Opus 4.7 max effort 1 million token context
Gemini 3.1 pro max

For AI issues: add Request ID with privacy disabled

9a5fad1e-f8d0-4f5d-ad9c-fff9d0211af6

Additional Information

I’d like to have this misused token count credited to my account. It was really sad to see my API usage go from 70% to 99% overnight at a no-output just ‘dead loop’ usage of Gemini - in a case where all the other models just stop processing and wait for the user to intervene.

Does this stop you from using Cursor

Yes - Cursor is unusable

Plan mode can get stuck in a loop where it repeatedly plans, requests a switch to agent mode, is denied (in this case because the laptop is closed), and then loops back to planning.

This is a known issue class that our team has been tracking. For now, I’d recommend avoiding leaving plan mode running unattended, especially with large context windows. If the model requests a mode switch and it’s not advancing, manually stopping the generation is the safest way to avoid token waste.

Regarding your request for a token credit, I completely understand the frustration. Since this requires account-level access, could you email [email protected] and reference this forum post? Our team can review the usage and process the credit from there.