Description
I am encountering a 400 Bad Request error when using the kimi-k2.6 model via the OpenCode Go proxy. The error occurs
specifically on the second or third turn of a conversation (once history is being sent back to the model).
Error Message:
400 Error from provider: Extra inputs are not permitted, field: 'messages[X].reasoning'
Diagnosis:
My client preserves the reasoning/thinking blocks from previous turns and sends them back in the messages array
within a reasoning field to maintain context.
It appears the OpenCode Go API gateway has a strict schema validation that rejects any fields not explicitly defined
in the standard OpenAI Chat Completions schema. I have verified that connecting directly to the Moonshot AI API
(bypassing OpenCode Go) works perfectly, as the Moonshot API ignores the extra reasoning field.
Plugins
N/A
OpenCode version
OpenCode Go API
Steps to reproduce
- Use the kimi-k2.6 model via the OpenCode Go proxy.
- Start a conversation and let the model generate a reasoning block.
- Send a second message to continue the conversation.
- The request fails with a 400 error because the history now contains the reasoning field, which is rejected by the
gateway validation.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
pi.dev
Description
I am encountering a 400 Bad Request error when using the kimi-k2.6 model via the OpenCode Go proxy. The error occurs
specifically on the second or third turn of a conversation (once history is being sent back to the model).
Error Message:
400 Error from provider: Extra inputs are not permitted, field: 'messages[X].reasoning'
Diagnosis:
My client preserves the reasoning/thinking blocks from previous turns and sends them back in the messages array
within a reasoning field to maintain context.
It appears the OpenCode Go API gateway has a strict schema validation that rejects any fields not explicitly defined
in the standard OpenAI Chat Completions schema. I have verified that connecting directly to the Moonshot AI API
(bypassing OpenCode Go) works perfectly, as the Moonshot API ignores the extra reasoning field.
Plugins
N/A
OpenCode version
OpenCode Go API
Steps to reproduce
gateway validation.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
pi.dev