From 78e4330fb23dc992291dae4cd75dbe506ad07aca Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 10 May 2026 05:33:54 +0100 Subject: [PATCH] fix: type xai runtime thinking levels --- extensions/xai/runtime-model-compat.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extensions/xai/runtime-model-compat.ts b/extensions/xai/runtime-model-compat.ts index b44de081398..bb8d1d6535a 100644 --- a/extensions/xai/runtime-model-compat.ts +++ b/extensions/xai/runtime-model-compat.ts @@ -3,10 +3,11 @@ import { applyXaiModelCompat } from "openclaw/plugin-sdk/provider-tools"; type XaiRuntimeModelCompat = { compat?: unknown; reasoning?: unknown; - thinkingLevelMap?: Partial< - Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh", string | null> - >; + thinkingLevelMap?: XaiThinkingLevelMap; }; +type XaiThinkingLevelMap = Partial< + Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh", string | null> +>; const XAI_UNSUPPORTED_REASONING_EFFORTS = { off: null, @@ -26,7 +27,9 @@ const XAI_REASONING_EFFORTS = { xhigh: "high", } satisfies NonNullable; -export function applyXaiRuntimeModelCompat(model: T): T { +export function applyXaiRuntimeModelCompat( + model: T, +): T & { thinkingLevelMap: XaiThinkingLevelMap } { const withCompat = applyXaiModelCompat(model); return { ...withCompat,