Skip to content

fix(ai-gateway): drop reasoning_effort when auto model sets reasoning config - #6949

Merged
chrarnoldus merged 1 commit into
mainfrom
fix/auto-model-drop-reasoning-effort
Sep 29, 2026
Merged

chrarnoldus merged 1 commit into
mainfrom
fix/auto-model-drop-reasoning-effort

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

When an auto model (e.g. kilo-auto/frontier or a variant-resolved kilo-auto/efficient decision) splices a reasoning config into a chat completions request, any client-supplied reasoning_effort was left in the body. Upstream providers can then receive conflicting reasoning settings.

applyResolvedAutoModel now deletes reasoning_effort from chat completions bodies whenever it sets reasoning. Requests where the auto model resolves without a reasoning config keep the client's reasoning_effort unchanged.

Verification

  • pnpm typecheck (apps/web)
  • oxlint on apps/web/src/lib/ai-gateway/auto-model
  • Added applyResolvedAutoModel tests in resolution.test.ts; test execution left to CI.

@chrarnoldus chrarnoldus self-assigned this Sep 29, 2026
@kilo-code-bot

kilo-code-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The change correctly deletes a client-supplied reasoning_effort from chat-completions bodies only when applyResolvedAutoModel splices in a resolved reasoning config, leaving it untouched on the no-reasoning path; the added tests cover both behaviors. No correctness, security, performance, or memory-leak issues found.

Files Reviewed (2 files)
  • apps/web/src/lib/ai-gateway/auto-model/resolution.ts
  • apps/web/src/lib/ai-gateway/auto-model/resolution.test.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

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