feat(ai): derive reasoning levels from provider metadata - #1258
Open
sethkarten wants to merge 3 commits into
Open
feat(ai): derive reasoning levels from provider metadata#1258sethkarten wants to merge 3 commits into
sethkarten wants to merge 3 commits into
Conversation
sethkarten
force-pushed
the
feat/provider-thinking-level-metadata
branch
from
August 11, 2026 20:21
07ecc8e to
c3b6e56
Compare
eliebak
previously approved these changes
Aug 11, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c3b6e56. Configure here.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
reasoningmetadata into exact model thinking-level maps, including sparse effort sets, mandatory reasoning,supported_efforts: null, and toggle-only modelsoff, serialize OpenRouter effort/toggle payloads correctly, and keep explicit-off behavior safe across Anthropic, Bedrock, Google, and Vertex adaptersoffthroughmaxthinking-level surfaceFor
qwen/qwen3.8-max, catalog generation now makesoffunavailable, exposesxhigh, and keeps unsupportedmaxhidden without a model-ID patch. It also fixes sparse Kimi/DeepSeek-style effort sets and models that expose only an enabled toggle.Rebased after #1247; the committed Qwen 3.8 Max entry is retained as featured and now carries its provider-derived mandatory effort map.
Validation
npx tsgo --noEmitanthropic-oauth.test.ts: 323 passed, 727 skippednpx biome check --error-on-warnings <modified files>git diff --checkScope
This PR covers reasoning capability discovery, UI level availability/clamping, and request selection. OpenRouter
reasoning.max_tokensbudgets and orderedreasoning_detailsreplay are separate continuity/budget features and are intentionally not included here.Note
Medium Risk
Changes how reasoning preferences are discovered and serialized for many OpenRouter/Prime Inference models, so incorrect maps or payload encoding could alter thinking behavior or break provider requests. No auth or data-handling changes.
Overview
Derives OpenRouter reasoning capabilities into exact
thinkingLevelMaps, covering sparse effort sets, mandatory reasoning, toggle-only models, andsupported_efforts: null. Generation applies this to both OpenRouter and Prime Inference catalogs, includingsupportsReasoningEffort: falsewhere only an enabled toggle exists.Fixes explicit
offvs omitted reasoning. Agents now pass"off"through instead of dropping it. Anthropic, Bedrock, Google, and Vertex treat"off"as disabled. OpenAI-completions serializes OpenRouter payloads with effort when supported, otherwise{ enabled: true/false }, and leaves omitted reasoning as the provider default.Reviewed by Cursor Bugbot for commit 25cc883. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Derive reasoning levels and effort support from OpenRouter provider metadata
getOpenRouterReasoningCapabilitieswhich reads OpenRouter model metadata to produce athinkingLevelMap,supportsReasoningEffort, andmandatoryflag, replacing static per-model hardcoding.thinkingLevelMapand settingsupportsReasoningEffort: falsewhere the provider does not expose effort selection.buildParamsinopenai-completions.tsto correctly encode explicit reasoning on/off intent for OpenRouter-compatible models, usingenabledtoggles when effort selection is unsupported."off"handling across Anthropic, Google, and Bedrock providers, which previously treated explicit"off"as enabled."off"reasoning throughAgent.createLoopConfigto providers instead of dropping it silently.enabledtoggle rather than areasoning_effortvalue;"off"now correctly disables thinking across all providers.Changes since #1258 opened
buildParamsutility in the OpenAI completions provider to omitreasoning_effortparameter when reasoning is not explicitly disabled [25cc883]Macroscope summarized c3b6e56.