fix: address lint curly rule and remove extra blank line

This commit is contained in:
Qinyao He
2026-04-06 03:18:18 -07:00
committed by Peter Steinberger
parent 8818184da0
commit 2989b78c12
2 changed files with 7 additions and 8 deletions

View File

@@ -47,7 +47,6 @@ function isAnthropicApi(modelApi?: string | null): boolean {
return modelApi === "anthropic-messages" || modelApi === "bedrock-converse-stream";
}
/**
* Provides a narrow replay-policy fallback for providers that do not have an
* owning runtime plugin.
@@ -95,7 +94,9 @@ function buildUnownedProviderTransportReplayFallback(params: {
},
}
: {}),
...(isAnthropic && modelId.includes("claude") ? { dropThinkingBlocks: !shouldPreserveThinkingBlocks(modelId) } : {}),
...(isAnthropic && modelId.includes("claude")
? { dropThinkingBlocks: !shouldPreserveThinkingBlocks(modelId) }
: {}),
...(isGoogle || isStrictOpenAiCompatible ? { applyAssistantFirstOrderingFix: true } : {}),
...(isGoogle || isStrictOpenAiCompatible ? { validateGeminiTurns: true } : {}),
...(isAnthropic || isStrictOpenAiCompatible ? { validateAnthropicTurns: true } : {}),

View File

@@ -72,7 +72,9 @@ export function buildStrictAnthropicReplayPolicy(
*/
export function shouldPreserveThinkingBlocks(modelId?: string): boolean {
const id = (modelId ?? "").toLowerCase();
if (!id.includes("claude")) return false;
if (!id.includes("claude")) {
return false;
}
// Models that preserve thinking blocks natively (Claude 4.5+):
// - claude-opus-4-x (opus-4-5, opus-4-6, ...)
@@ -81,11 +83,7 @@ export function shouldPreserveThinkingBlocks(modelId?: string): boolean {
// - claude-haiku-4-x (haiku-4-5, ...)
// Models that require dropping thinking blocks:
// - claude-3-7-sonnet, claude-3-5-sonnet, and earlier
if (
id.includes("opus-4") ||
id.includes("sonnet-4") ||
id.includes("haiku-4")
) {
if (id.includes("opus-4") || id.includes("sonnet-4") || id.includes("haiku-4")) {
return true;
}