refactor(agents): drop unused session runtime override helper · openclaw/openclaw@4df8237
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,11 +3,9 @@
|
3 | 3 | * |
4 | 4 | * Resolves persisted runtime overrides without leaking provider-specific CLI runtime bindings across model routes. |
5 | 5 | */ |
6 | | -import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce"; |
7 | 6 | import type { SessionEntry } from "../config/sessions.js"; |
8 | 7 | import { isDefaultAgentRuntimeId } from "./agent-runtime-id.js"; |
9 | 8 | import { normalizeOptionalAgentRuntimeId } from "./agent-runtime-id.js"; |
10 | | -import { resolveCliRuntimeModelBackendBinding } from "./cli-backends.js"; |
11 | 9 | |
12 | 10 | /** Persisted runtime fields used to recover session runtime compatibility. */ |
13 | 11 | type SessionRuntimeCompatEntry = Pick< |
@@ -25,24 +23,3 @@ export function resolvePersistedSessionRuntimeId(
|
25 | 23 | } |
26 | 24 | return normalizeOptionalAgentRuntimeId(entry?.agentHarnessId); |
27 | 25 | } |
28 | | - |
29 | | -/** Resolves whether a session runtime override applies to the selected provider. */ |
30 | | -export function resolveSessionRuntimeOverrideForProvider(params: { |
31 | | -provider: string; |
32 | | -entry?: Pick<SessionEntry, "agentRuntimeOverride">; |
33 | | -}): string | undefined { |
34 | | -const provider = normalizeLowercaseStringOrEmpty(params.provider); |
35 | | -const runtime = normalizeOptionalAgentRuntimeId(params.entry?.agentRuntimeOverride); |
36 | | -if (!runtime || isDefaultAgentRuntimeId(runtime)) { |
37 | | -return undefined; |
38 | | -} |
39 | | -if (runtime === "openclaw") { |
40 | | -return "openclaw"; |
41 | | -} |
42 | | -if (provider === "openai" && runtime === "codex") { |
43 | | -return "codex"; |
44 | | -} |
45 | | -// CLI runtime bindings are provider-specific; an override from another |
46 | | -// provider must not leak into this session's model route. |
47 | | -return resolveCliRuntimeModelBackendBinding({ provider, runtime })?.runtime; |
48 | | -} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。