From 4df8237a01ee92736f058a1fe69d2bb6b93ef67c Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 17 Jun 2026 09:18:35 +0800 Subject: [PATCH] refactor(agents): drop unused session runtime override helper --- src/agents/session-runtime-compat.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/agents/session-runtime-compat.ts b/src/agents/session-runtime-compat.ts index 546d466f5350..b7fc92f74627 100644 --- a/src/agents/session-runtime-compat.ts +++ b/src/agents/session-runtime-compat.ts @@ -3,11 +3,9 @@ * * Resolves persisted runtime overrides without leaking provider-specific CLI runtime bindings across model routes. */ -import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce"; import type { SessionEntry } from "../config/sessions.js"; import { isDefaultAgentRuntimeId } from "./agent-runtime-id.js"; import { normalizeOptionalAgentRuntimeId } from "./agent-runtime-id.js"; -import { resolveCliRuntimeModelBackendBinding } from "./cli-backends.js"; /** Persisted runtime fields used to recover session runtime compatibility. */ type SessionRuntimeCompatEntry = Pick< @@ -25,24 +23,3 @@ export function resolvePersistedSessionRuntimeId( } return normalizeOptionalAgentRuntimeId(entry?.agentHarnessId); } - -/** Resolves whether a session runtime override applies to the selected provider. */ -export function resolveSessionRuntimeOverrideForProvider(params: { - provider: string; - entry?: Pick; -}): string | undefined { - const provider = normalizeLowercaseStringOrEmpty(params.provider); - const runtime = normalizeOptionalAgentRuntimeId(params.entry?.agentRuntimeOverride); - if (!runtime || isDefaultAgentRuntimeId(runtime)) { - return undefined; - } - if (runtime === "openclaw") { - return "openclaw"; - } - if (provider === "openai" && runtime === "codex") { - return "codex"; - } - // CLI runtime bindings are provider-specific; an override from another - // provider must not leak into this session's model route. - return resolveCliRuntimeModelBackendBinding({ provider, runtime })?.runtime; -}