fix: enforce final tag gating (#754) (thanks @mcinteerj)

This commit is contained in:
Peter Steinberger
2026-01-12 08:45:23 +00:00
parent a7cb270999
commit 252841ab13
5 changed files with 13 additions and 52 deletions

View File

@@ -7,10 +7,12 @@
* (e.g. <think> and <final>) in the text stream, rather than using native
* API fields for reasoning/thinking.
*/
export function isReasoningTagProvider(provider: string | undefined | null): boolean {
export function isReasoningTagProvider(
provider: string | undefined | null,
): boolean {
if (!provider) return false;
const normalized = provider.trim().toLowerCase();
// Check for exact matches or known prefixes/substrings for reasoning providers
if (
normalized === "ollama" ||
@@ -19,7 +21,7 @@ export function isReasoningTagProvider(provider: string | undefined | null): boo
) {
return true;
}
// Handle google-antigravity and its model variations (e.g. google-antigravity/gemini-3)
if (normalized.includes("google-antigravity")) {
return true;
@@ -29,6 +31,6 @@ export function isReasoningTagProvider(provider: string | undefined | null): boo
if (normalized.includes("minimax")) {
return true;
}
return false;
}