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
Bug: 400 Error (Extra inputs not permitted) when sending 'reasoning' field in chat history for kimi-k2.6 #27852
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.
I've seen this same issue if it doesn't meet the exact schema. It'd be helpful to optionally strip this extra metadata. Specifically, I was able to reproduce with a custom provider (@ai-sdk/openai-compatible with an api, gpt-5 and gpt-5.5, that failed with any extra fields). GET /models and direct POST /chat/completions would work, but once it started using the OpenCode request path it would fail (Invalid request format).
Activity
github-actions commentedon May 16, 2026
This issue might be a duplicate of existing issues. Please check:
mrlunchbox777 commentedon May 19, 2026
I've seen this same issue if it doesn't meet the exact schema. It'd be helpful to optionally strip this extra metadata. Specifically, I was able to reproduce with a custom provider (@ai-sdk/openai-compatible with an api, gpt-5 and gpt-5.5, that failed with any extra fields).
GET /modelsand directPOST /chat/completionswould work, but once it started using the OpenCode request path it would fail (Invalid request format).github-actions commentedon Jul 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.