Skip to content

fix(kimi-coding): disable reasoning for Roo Code-based clients#2839

Merged
chrarnoldus merged 2 commits intomainfrom
chrarnoldus/disable-reasoning-kimi-coding-for-kilo-code
Apr 28, 2026
Merged

fix(kimi-coding): disable reasoning for Roo Code-based clients#2839
chrarnoldus merged 2 commits intomainfrom
chrarnoldus/disable-reasoning-kimi-coding-for-kilo-code

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented Apr 28, 2026

Summary

  • The old Roo-based Kilo Code client does not preserve reasoning correctly, so for requests coming from that client we now force Kimi Code's `thinking.type` to `disabled`.
  • Thread `originalHeaders` through `TransformRequestContext` so providers can key behavior off the originating client's headers.

Verification

  • Inspected the kimi-coding transform output locally: `thinking.type` is `disabled` when the incoming user-agent begins with `Kilo-Code/`, and `enabled` otherwise (unless reasoning is explicitly disabled in the request).

Visual Changes

N/A

Reviewer Notes

  • The new `originalHeaders` field on `TransformRequestContext` is non-optional; all call sites of `applyProviderSpecificLogic` and `provider.transformRequest` have been updated.
  • Behavior for other BYOK providers (zai-coding, byteplus-coding, neurowatt) is unchanged.

Kimi Code's `thinking` parameter was enabled by default for all BYOK
requests, which fails for older Roo Code-based clients that don't expect
reasoning output. Detect those clients via the incoming user-agent and
force `thinking.type = 'disabled'` for them.

Threads fraudHeaders through the transformRequest context so providers
can inspect the originating client.
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented Apr 28, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • apps/web/src/app/api/openrouter/[...path]/route.ts
  • apps/web/src/lib/ai-gateway/providers/direct-byok/kimi-coding.ts
  • apps/web/src/lib/ai-gateway/providers/index.ts
  • apps/web/src/lib/ai-gateway/providers/types.ts

Reviewed by gpt-5.5-2026-04-23 · 609,024 tokens

@chrarnoldus chrarnoldus merged commit e4e4c2b into main Apr 28, 2026
16 checks passed
@chrarnoldus chrarnoldus deleted the chrarnoldus/disable-reasoning-kimi-coding-for-kilo-code branch April 28, 2026 09:58
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.

2 participants