bug: long thinking / blocking with gemini provider
Resolved 💬 11 comments Opened Apr 22, 2025 by qcname Closed Sep 3, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
_No response_
Which model were you using?
_No response_
What platform is your computer?
_No response_
What steps can reproduce the bug?
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
11 Comments
I use curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=my_api_key" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents": [{
"parts":[{"text": "Explain how AI works"}]
}]
}'
There can be results, but codex has been waiting for 313s.
When I switched to deepseek, there was no waiting at all, no thinking time, and no results.
Not sure, but if you can consistently repro please add more details. Also will accept a PR for a fix here!
i have the same problem,i thing this is a bug
<img width="569" alt="Image" src="https://github.com/user-attachments/assets/86610a0a-dce1-4c75-88ad-372205f0271f" />
that‘s ok:
<img width="617" alt="Image" src="https://github.com/user-attachments/assets/74283d5a-15f6-44e8-ae99-77c408ae9b0b" />
but:
<img width="887" alt="Image" src="https://github.com/user-attachments/assets/9522cdb1-3677-4e8f-a2da-69b1a9239a3e" />
Just a note related to this:
After https://github.com/openai/codex/pull/563 "Thinking" could mean that it's waiting for the rate limit backoff. Don't think this was the case here as this is before the PR, but something to keep an eye out after
!Image
When I use the OpenRouter model, there can be results, whether it is a paid deepseek-v3 or a free model (see the picture above). Although the previous situation still occurs, I will use OpenRouter in the future
You can try openrouter.
I have to add some details, I am really confused, the previous use of openrouter's 【codex -p openrouter -m google/gemini-2.0-flash-exp: free】 has results, right? But trying some of the rest of the models provided by openrouter will not work. My detailed process is: go to the official website of openrouter to get the api-key, and export OPENROUTER_API_KEY. The remaining models are sent just after I enter, no thinking, no answer. Why in the end.
!Image
!Image
!Image
But when I used gemini's API_KEY to do it, it kept getting stuck.
!Image
What a big bug.
!Image
Well now there is nothing, no thought process at all, no output, why on earth is it pai
Can you take a look at this bug?
Closing this as out of date, please re-file an issue if still relevant, thanks!