Openai-chat enter infite loop
Describe the bug
openrouter/xai/grok-4-fast:free. Run into infinite loop.
To Reproduce Steps to reproduce the behavior:
- Use
openrouter/xai/grok-4-fast:free - Input any content
- Infinite loop(stuck generating...)
Expected behavior Should continue
Additional context Infinite print logs in stderr like
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [751] {:id "gen-1759117741-mgIaq7pDWMSwzN2eelIH", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117741, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [751] {:id "gen-1759117741-mgIaq7pDWMSwzN2eelIH", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117741, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [751] {:id "gen-1759117741-mgIaq7pDWMSwzN2eelIH", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117741, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [751] {:id "gen-1759117741-mgIaq7pDWMSwzN2eelIH", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117741, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [751] {:id "gen-1759117741-mgIaq7pDWMSwzN2eelIH", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117741, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [751] {:id "gen-1759117741-mgIaq7pDWMSwzN2eelIH", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117741, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
[OPENAI-CHAT] [6708] {:id "gen-1759117718-Pll80GnkWWUjePL2xWqb", :provider "xAI", :model "x-ai/grok-4-fast:free", :object "chat.completion.chunk", :created 1759117718, :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning nil, :reasoning_details []}, :finish_reason nil, :native_finish_reason nil, :logprobs nil}], :system_fingerprint "fp_9362061f30"}
Maybe it's llm provider issuse.
If it's free, I can try to repro and understand, will check it
@jilen I can't repro that actually, it works smoothly:
Is there any specific prompt?
Happens while editing/create file.
I can't repro yet, do you have a screenshot or logs?
Hm, I cannot produce in another pc, let me close it now.