feat(ai): implemented fallback handling and option for qwen reasoning effort

- Added `qwenTemplateReasoningEffort` model compatibility option to disable Qwen chat template kwargs for strict local servers.
- Implemented fallback handling to strip rejected `chat_template_kwargs.reasoning_effort` and hoist values to top-level fields.
- Added comprehensive test coverage for Qwen reasoning effort fallback and keyword rejections.
This commit is contained in:
can1357
2026-08-19 17:40:39 +02:00
parent 7099457f84
commit 74bc1f442e
7 changed files with 267 additions and 5 deletions
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Added
- Added `qwenTemplateReasoningEffort` to the `models.yml` `compat` schema, so the auto-enabled Qwen 3.8+ template effort dialect (`chat_template_kwargs.reasoning_effort`) can be switched off per provider/model for strict local servers that reject unknown `chat_template_kwargs`.
### Changed
- `/settings` rows can now carry a risk note: a warning glyph on the row plus a warning-colored line above the description. `External Thinking` (`externalThinking`, `--external-thinking`) is the first user — providers have flagged the request shape it produces as abuse, up to account-level enforcement, so both the settings entry and `--help` now say so.
@@ -42,6 +42,7 @@ export const getModelsConfigSchemaBundle = once(() => {
"disableReasoningOnForcedToolChoice?": "boolean",
"disableReasoningOnToolChoice?": "boolean",
"thinkingFormat?": '"openai" | "openrouter" | "zai" | "qwen" | "qwen-chat-template"',
"qwenTemplateReasoningEffort?": "boolean",
"openRouterRouting?": OpenRouterRoutingSchema,
"vercelGatewayRouting?": VercelGatewayRoutingSchema,
"extraBody?": { "[string]": "unknown" },