Skip to content

Commit c142ec1

Browse files
fix(clawsweeper): address review for automerge-openclaw-openclaw-84142 (validation-1)
Co-authored-by: David <[email protected]> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
1 parent 177404d commit c142ec1

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/gateway/gateway-models.profiles.live.test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,10 +2228,22 @@ function getProviderThinkingModelCompat(model: Model): ProviderThinkingModelComp
22282228
if (!compat || typeof compat !== "object") {
22292229
return undefined;
22302230
}
2231-
if ("thinkingFormat" in compat || "supportedReasoningEfforts" in compat) {
2232-
return compat as ProviderThinkingModelCompat;
2233-
}
2234-
return undefined;
2231+
const record = compat as Record<string, unknown>;
2232+
const thinkingFormat =
2233+
typeof record.thinkingFormat === "string" ? record.thinkingFormat : undefined;
2234+
const supportedReasoningEfforts =
2235+
Array.isArray(record.supportedReasoningEfforts) &&
2236+
record.supportedReasoningEfforts.every((value) => typeof value === "string")
2237+
? record.supportedReasoningEfforts
2238+
: record.supportedReasoningEfforts === null
2239+
? null
2240+
: undefined;
2241+
return thinkingFormat || supportedReasoningEfforts !== undefined
2242+
? {
2243+
...(thinkingFormat ? { thinkingFormat } : {}),
2244+
...(supportedReasoningEfforts !== undefined ? { supportedReasoningEfforts } : {}),
2245+
}
2246+
: undefined;
22352247
}
22362248

22372249
function resolveGatewayLiveThinkingLevel(params: { raw?: string; smoke: boolean }): string {

0 commit comments

Comments
 (0)