fix: gate always-thinking inference to OpenAI wires, plus catalog review follow-ups#2036
Conversation
…ow-ups - catalog: strip the inferred alwaysThinking marker on non-OpenAI wires so Claude/Gemini keep their native off; verified against live models.dev - v1 provider-manager: honor per-alias baseUrl on kimi/google-genai/vertexai - thinking: rewrite the PHASE-6 contract comment, drop three dead cannot-disable warning branches, normalize requested effort in v1 to match v2 - tests: input-cap compaction preference in both engines, kap-server WS status cap, v2 legacy status input cap - docs + changeset: new model fields, catalog-refresh behavior, kap-server
|
| Name | Type |
|---|---|
| @moonshot-ai/kosong | Patch |
| @moonshot-ai/kimi-code-sdk | Patch |
| @moonshot-ai/agent-core | Patch |
| @moonshot-ai/agent-core-v2 | Patch |
| @moonshot-ai/kap-server | Patch |
| @moonshot-ai/kimi-code | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab496f97aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The previous gate kept the marker only on the OpenAI wires, which wrongly
stripped it from Gemini 3 on the Google wires: its floor is
thinkingLevel MINIMAL with suppressed thoughts — still reasoning — so an
Off option there would be a lie. The criterion is now the wire's encoding,
not its family: strip only on anthropic and kimi, the two wires with a
protocol-level `thinking: {type: 'disabled'}` that the catalog's effort
list can never show. Verified against live models.dev data: google now
marks exactly the gemini-3 family (10), anthropic and moonshotai stay 0.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d22acdee3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const protocol = model.protocol ?? providerWire; | ||
| if ( | ||
| model.alwaysThinking === true && | ||
| (protocol === 'anthropic' || protocol === 'kimi') |
There was a problem hiding this comment.
Keep Off available for non-Gemini-3 Google models
For Google/Vertex catalog models whose id is not gemini-3 but whose reasoning_options list has effort levels and no none/toggle, this condition leaves the inferred alwaysThinking marker in place because it only strips Anthropic/Kimi. That marker is persisted as always_thinking, and both engines clamp off back to a default effort, but the Google provider actually encodes off for non-Gemini-3 models as thinkingBudget: 0 (packages/kosong/src/providers/google-genai.ts), so those users lose a working Off setting. Please make the Google exception depend on the model family, keeping the marker only for Gemini 3 rather than the whole Google wire.
Useful? React with 👍 / 👎.
…nking.ts file header The scoped guide keeps comments in the top-of-file block only; the function JSDoc shrinks to a short what-it-answers note matching its neighbors. No behavior change.
Post-merge review follow-ups to #2015 and #2030, from a four-way deep review (catalog/kosong, v1 engine, v2 engine, tests & docs).
Blocker:
alwaysThinkinginference misfired on Claude/GeminiThe inference introduced in #2030 ("efforts present, no
none, notoggle→ always-thinking") is name-agnostic but wrong for the Anthropic/Google wires: Claude has a native off encoding (thinking: {type: 'disabled'}) that models.dev does not represent inefforts, so ~150 Claude-named models across anthropic/zenmux/opencode-shaped catalogs would have been markedalways_thinkingwith no way to turn thinking off.Fix:
catalogProviderModelsnow strips the inferred marker when the model's final wire is notopenai/openai_responses(per-model protocol overrides included). Verified against live models.dev data (168 providers):anthropic(12),google(17),moonshotai(10): 0 models markedopenai: 23 models keep the marker (gpt-5-codex, o1, o3, …) — the intended populationk3carries an explicittoggle, other Kimi entries declare noreasoning_options, so the inference never fired for them even before this fixDeliberate trade-off: Claude served over openai-compatible gateways (e.g. github-copilot) keeps the marker — on that wire the only off encoding is
reasoning_effort: 'none', which the catalog says the model rejects. Conservative direction (no Off offered) beats offering an option that errors upstream.Other fixes
provider-manager: kimi/google-genai/vertexai branches dropped a per-aliasbaseUrl(v2 already honored it for all wires)strictonly governs effort validation), deleted three unreachableanthropic-thinking-cannot-disablewarning branches, and normalized the requested effort value in v1 to match v2 (trim/lowercase, invalid values fall back to the model default)max_input_tokensassertion, v2 legacy status input-cap denominatormax_input_size/off_effort/base_urlfield rows, catalog-refresh import behavior, zh wording,@moonshot-ai/kap-serverchangeset entryVerification
tsc --noEmitclean on kosong / agent-core / agent-core-v2 / kap-server / node-sdkoxlint --type-aware0 errors on touched files (2 remaining warnings verified pre-existing on HEAD)Out of scope (deliberately)
max_input_tokens ?? max_context_tokenssites across both engines deserve a shared helper — separate PR