fix: type reasoning compat transcript policy · openclaw/openclaw@2a257f5
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -84,6 +84,11 @@ function isClaudeFamilyModelId(modelId?: string | null): boolean {
|
84 | 84 | return /(?:^|[./:_-])claude(?:$|[./:_-])/.test(id); |
85 | 85 | } |
86 | 86 | |
| 87 | +function modelDisablesReasoningEffort(model?: ProviderRuntimeModel): boolean { |
| 88 | +const compat = model?.compat as { supportsReasoningEffort?: boolean } | undefined; |
| 89 | +return compat?.supportsReasoningEffort === false; |
| 90 | +} |
| 91 | + |
87 | 92 | /** |
88 | 93 | * Provides a narrow replay-policy fallback for providers that do not have an |
89 | 94 | * owning runtime plugin. |
@@ -138,7 +143,7 @@ function buildUnownedProviderTransportReplayFallback(params: {
|
138 | 143 | ...(isAnthropic && modelId.includes("claude") |
139 | 144 | ? { dropThinkingBlocks: !shouldPreserveThinkingBlocks(modelId) } |
140 | 145 | : {}), |
141 | | - ...(isAnthropic && params.model?.compat?.supportsReasoningEffort === false |
| 146 | + ...(isAnthropic && modelDisablesReasoningEffort(params.model) |
142 | 147 | ? { dropThinkingBlocks: true } |
143 | 148 | : {}), |
144 | 149 | ...(isStrictOpenAiCompatible && isGemma4ModelRequiringReasoningStrip(modelId) |
@@ -226,7 +231,7 @@ function resolveTranscriptPolicyCacheKey(params: {
|
226 | 231 | provider: params.provider, |
227 | 232 | modelApi: params.modelApi ?? "", |
228 | 233 | modelId: params.modelId ?? "", |
229 | | -dropsThinkingForReasoningCompat: params.model?.compat?.supportsReasoningEffort === false, |
| 234 | +dropsThinkingForReasoningCompat: modelDisablesReasoningEffort(params.model), |
230 | 235 | workspaceDir: params.workspaceDir ?? "", |
231 | 236 | pluginControlPlane: resolvePluginControlPlaneFingerprint({ |
232 | 237 | config: params.config, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。