From 2989b78c1265bf74e2445a797e995ae2f4fcffd2 Mon Sep 17 00:00:00 2001 From: Qinyao He Date: Mon, 6 Apr 2026 03:18:18 -0700 Subject: [PATCH] fix: address lint curly rule and remove extra blank line --- src/agents/transcript-policy.ts | 5 +++-- src/plugins/provider-replay-helpers.ts | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/agents/transcript-policy.ts b/src/agents/transcript-policy.ts index eb0f390c7d9..ed5c7a14eef 100644 --- a/src/agents/transcript-policy.ts +++ b/src/agents/transcript-policy.ts @@ -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 } : {}), diff --git a/src/plugins/provider-replay-helpers.ts b/src/plugins/provider-replay-helpers.ts index 16efa6c3a01..902e5505825 100644 --- a/src/plugins/provider-replay-helpers.ts +++ b/src/plugins/provider-replay-helpers.ts @@ -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; }