Skip to content

Fix: name for reasoning_context for openai provider#2940

Open
jaljoue wants to merge 6 commits intoyetone:mainfrom
jaljoue:reasoning-fix
Open

Fix: name for reasoning_context for openai provider#2940
jaljoue wants to merge 6 commits intoyetone:mainfrom
jaljoue:reasoning-fix

Conversation

@jaljoue
Copy link
Contributor

@jaljoue jaljoue commented Jan 28, 2026

I was testing out Kimi K2.5 through OpenRouter which inherits from the OpenAI provider, and noticed that there was missing reasoning_context after requests. Tracked it down to the add_thinking_messages function, was a simple typo.

This may also close #2851 , but I would need someone to test that I don't have Deepseek setup as a provider.

Error: {
  code = 400,
  message = "Provider returned error",
  metadata = {
    is_byok = false,
    provider_name = "Moonshot AI",
    raw = '{"error":{"message":"thinking is enabled but reasoning_content is missing in assistant tool call message at index 4","type":"invalid_request_error"}}'
  }
} 

@CodingPapi
Copy link

CodingPapi commented Jan 28, 2026

after apply this, kimi keep reporting reasoning_content is missing in assistant tool call message at index 6

@jaljoue
Copy link
Contributor Author

jaljoue commented Jan 29, 2026

after apply this, kimi keep reporting reasoning_content is missing in assistant tool call message at index 6

Interesting, I will keep testing. @CodingPapi curious did you test with Openrouter or with Moonshot directly?

@CodingPapi
Copy link

after apply this, kimi keep reporting reasoning_content is missing in assistant tool call message at index 6

Interesting, I will keep testing. @CodingPapi curious did you test with Openrouter or with Moonshot directly?

nope, only try this with Avante

@CodingPapi
Copy link

after apply this, kimi keep reporting reasoning_content is missing in assistant tool call message at index 6

Interesting, I will keep testing. @CodingPapi curious did you test with Openrouter or with Moonshot directly?

Hi, have you reproduce this? is it a better solution that we create a specific provider only for kimi?

@CodingPapi
Copy link

this is related info: anomalyco/opencode#4947
may help

@INFCode
Copy link

INFCode commented Feb 2, 2026

Tried this PR with Deepseek's API in a new Ask, but got this error almost immediately:

Error: {
  code = "invalid_request_error",
  message = "Missing `reasoning_content` field in the assistant message at message index 4. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_mode#tool-calls",
  param = vim.NIL,
  type = "invalid_request_error"
}

@jaljoue
Copy link
Contributor Author

jaljoue commented Feb 3, 2026

Tried this PR with Deepseek's API in a new Ask, but got this error almost immediately:

Error: {
  code = "invalid_request_error",
  message = "Missing `reasoning_content` field in the assistant message at message index 4. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_mode#tool-calls",
  param = vim.NIL,
  type = "invalid_request_error"
}

@INFCode When you have a chance could you try again with the latest changes? I had some other changes in a different branch that was a more complex change but might also fix it.

@INFCode
Copy link

INFCode commented Feb 4, 2026

Tried this PR with Deepseek's API in a new Ask, but got this error almost immediately:

Error: {
  code = "invalid_request_error",
  message = "Missing `reasoning_content` field in the assistant message at message index 4. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_mode#tool-calls",
  param = vim.NIL,
  type = "invalid_request_error"
}

@INFCode When you have a chance could you try again with the latest changes? I had some other changes in a different branch that was a more complex change but might also fix it.

With the new changes, this time the ask session runs slightly longer, but there's still some problem. This time Deepseek shows a short thought and executes a Bash command successfully, but then it throws the same error.

@jaljoue
Copy link
Contributor Author

jaljoue commented Feb 8, 2026

@INFCode @CodingPapi Think it should be working now, I tested with Deepseek API as well, i'll try with some others to double check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: deepseek fail with Missing reasoning_content

3 participants