The very first LLM call from the app fails with an empty response from the model. The second call with the exact same prompt works — the failure is only on the first invocation after a cold start (or session open).
Empty response from model (provider=minimax-token-plan, model=MiniMax-M3, chat_model_chunks=314, other_events=36:on_chain_start,on_chain_start,on_chain_end,on_chain_start,on_chain_end).
Last chunk: {"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":[],"additional_kwargs":{"stop_reason":"max_tokens"},"tool_call_chunks":[],"usage_metadata":{"input_tokens":0,"output_tokens":4096,"total_tokens":4096},"response_metadata":{},"id":"run-019fa5b2-ab3f-735a-8f97-69329f5c7e31","tool_calls":[],"invalid_tool_calls":[]}}
The first LLM call should produce a normal response, same as subsequent calls.
First call fails with the empty-response error above; second call with the identical prompt succeeds.
Summary
The very first LLM call from the app fails with an empty response from the model. The second call with the exact same prompt works — the failure is only on the first invocation after a cold start (or session open).
Error message
Observations from the error
model:MiniMax-M3stop_reason:max_tokensoutput_tokens:4096(hit the per-call cap on a response that was discarded)content:[](model emitted no text / tool calls before hitting the cap)input_tokens:0(the request appears to have been sent with an empty prompt, or the prompt accounting was lost)chat_model_chunks:314(the stream produced many chunks but none carriedcontent)AIMessageChunkis empty, so the app reports "Empty response from model"Steps to reproduce
Expected
The first LLM call should produce a normal response, same as subsequent calls.
Actual
First call fails with the empty-response error above; second call with the identical prompt succeeds.
Hypotheses to investigate
input_tokens: 0), causing the model to immediately hitmax_tokenswhile producing no content.minimax-token-plan/MiniMax-M3after a cold start may not receive a proper prompt.content— possible bug in how the first stream is consumed (e.g. noAIMessageChunkis finalized).output_tokens: 4096is suspiciously the model cap; the first call may be silently retried / looped until the cap is exhausted.Environment
minimax-token-planMiniMax-M3