Skip to content

fix(ai-gateway): order reasoning variants ascending - #5085

Merged
chrarnoldus merged 1 commit into
mainfrom
chatter-safflower
Aug 6, 2026
Merged

chrarnoldus merged 1 commit into
mainfrom
chatter-safflower

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • order fallback reasoning variants from none / minimal through max
  • reverse OpenRouter-reported reasoning efforts and keep none first for optional reasoning
  • align custom OpenCode variant ordering with Kilo clients and OpenCode
  • add focused coverage for fallback and OpenRouter-derived ordering

Validation

  • pnpm --filter web test --runInBand src/lib/ai-gateway/providers/variants.test.ts src/lib/ai-gateway/providers/model-settings.test.ts src/lib/ai-gateway/custom-llm/order-opencode-variants.test.ts src/lib/ai-gateway/providers/direct-byok/sync-direct-byok.test.ts
  • pnpm --filter web run typecheck
  • pnpm exec oxlint --config .oxlintrc.json <changed files>
  • pnpm format
  • pnpm exec oxfmt --list-different <changed files>
  • git diff --check

All pnpm commands emitted the existing engine warning because the local runtime is Node 26 while the repository requires Node 24.

@chrarnoldus chrarnoldus self-assigned this Aug 6, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reasoning-variant reordering to ascending intensity is internally consistent across fallback constants, OpenRouter-derived variants, and OpenCode ordering helpers; renamed constants have no stale references, ReasoningEffortSchema.options confirms the ascending order relied on by the OpenAI fallback, toReversed() is non-mutating and already used in this codebase, and all order-sensitive consumers use key lookup or set membership rather than positional selection. Tests were updated consistently, including new coverage pinning the reverse-and-none-first behavior.

Files Reviewed (7 files)
  • apps/web/src/lib/ai-gateway/custom-llm/order-opencode-variants.test.ts
  • apps/web/src/lib/ai-gateway/custom-llm/order-opencode-variants.ts
  • apps/web/src/lib/ai-gateway/providers/direct-byok/sync-direct-byok.test.ts
  • apps/web/src/lib/ai-gateway/providers/model-settings.test.ts
  • apps/web/src/lib/ai-gateway/providers/model-settings.ts
  • apps/web/src/lib/ai-gateway/providers/variants.test.ts
  • apps/web/src/lib/ai-gateway/providers/variants.ts

Reviewed by kimi-k3 · Input: 54.8K · Output: 13.9K · Cached: 598.6K

Review guidance: REVIEW.md from base branch main

@chrarnoldus
chrarnoldus merged commit 866ed12 into main Aug 6, 2026
16 checks passed
@chrarnoldus
chrarnoldus deleted the chatter-safflower branch August 6, 2026 10:02
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