You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
APIEmptyResponseError: thinking model (Kimi-K2.6 via Azure / openai-compatible provider) returns reasoning-only completion on the step that continues after a tool call #520
Custom provider — Azure AI Foundry serverless deployment of Kimi-K2.6, configured manually in config.toml (OpenAI-compatible endpoint), not via /login.
Which model were you using?
azure/Kimi-K2.6 (thinking = high)
What platform is your computer?
Windows (win32 x64), Node.js v24.15.0
What issue are you seeing?
With thinking enabled, a turn fails when a step continues after a tool call. The follow-up step returns a completion containing only reasoning content — empty content, no tool_calls — with finishReason=stop, and the provider raises APIEmptyResponseError. All 3 retries return the same, and the turn fails.
Full error:
[2026-06-07T15:04:52] WARN llm request failed turnStep=0.2 attempt=3/3 model=azure/Kimi-K2.6
errorName=APIEmptyResponseError
errorMessage="The API returned a response containing only thinking content without any text or tool calls. This usually indicates the stream was interrupted or the output token budget was exhausted during reasoning. Provider stop details: finishReason=completed, rawFinishReason=stop. Provider: openai, model: Kimi-K2.6"
[2026-06-07T15:04:52] ERROR turn failed turnId=0
The preceding step succeeded and used only 428 output tokens (usage: inputOther=20164, output=428), so the model is not running out of output budget — it stops naturally (rawFinishReason=stop) having emitted reasoning only.
This looks less like a transient stream interruption and more like the OpenAI-compatible adapter is conflating a reasoning-only stop with a truly empty provider response.
A few checks/fix points I would try:
Capture the raw final message for both streaming and non-streaming calls. If Kimi/Azure is returning reasoning in a provider-specific field such as reasoning_content while content and tool_calls are empty, that should probably be classified differently from a transport-empty response.
Only raise APIEmptyResponseError when content, tool_calls, and any known reasoning payload fields are all absent. If reasoning exists and rawFinishReason=stop, the model did produce something; it just did not produce user-visible content.
Add a special retry path for the step immediately after a tool result: retry once with thinking disabled/lowered, or add an explicit continuation instruction like "after tool results, return visible assistant content or a tool call, not reasoning only". Your note that the previous step used only 428 output tokens is a good clue that this is not simply exhausted output budget.
Regression test idea: mock an OpenAI-compatible response where finish_reason=stop, content="", no tool_calls, but reasoning_content is present. The expected behavior should be either a controlled continuation retry or a distinct "reasoning-only final" error, not the same interrupted/budget-exhausted diagnosis.
The key distinction is: empty visible content after a tool call can be a valid provider/model behavior in thinking mode, even though it is not a valid next action for the agent loop.
Activity
lianzhiweivincent-cloud commentedon Jun 11, 2026
This looks less like a transient stream interruption and more like the OpenAI-compatible adapter is conflating a reasoning-only stop with a truly empty provider response.
A few checks/fix points I would try:
Capture the raw final message for both streaming and non-streaming calls. If Kimi/Azure is returning reasoning in a provider-specific field such as
reasoning_contentwhilecontentandtool_callsare empty, that should probably be classified differently from a transport-empty response.Only raise
APIEmptyResponseErrorwhencontent,tool_calls, and any known reasoning payload fields are all absent. If reasoning exists andrawFinishReason=stop, the model did produce something; it just did not produce user-visible content.Add a special retry path for the step immediately after a tool result: retry once with thinking disabled/lowered, or add an explicit continuation instruction like "after tool results, return visible assistant content or a tool call, not reasoning only". Your note that the previous step used only 428 output tokens is a good clue that this is not simply exhausted output budget.
Regression test idea: mock an OpenAI-compatible response where
finish_reason=stop,content="", notool_calls, butreasoning_contentis present. The expected behavior should be either a controlled continuation retry or a distinct "reasoning-only final" error, not the same interrupted/budget-exhausted diagnosis.The key distinction is: empty visible content after a tool call can be a valid provider/model behavior in thinking mode, even though it is not a valid next action for the agent loop.
fix: harden azure-foundry provider for Foundry runtime issues
fix(kosong): preserve Kimi's native tool-call id format
fix(kosong): preserve Kimi's native tool-call id format