Description
Some thinking models like kimi-k2-thinking fail when invoked via the Kilo Gateway with the error:
Reasoning is mandatory for this endpoint and cannot be disabled.
This affects:
kimi-k2-thinking (and potentially other -thinking suffix models) via @kilocode/kilo-gateway
Expected Behavior
Thinking models should work out of the box without requiring manual reasoning toggle.
Root Cause
The ProviderTransform.options() function in packages/opencode/src/provider/transform.ts was not adding reasoning: { enabled: true } for thinking models accessed via Kilo Gateway.
Fix
Add logic to automatically enable reasoning for models that:
- Use
@kilocode/kilo-gateway SDK
- Have
reasoning capability
- Have "thinking" in their model ID