惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
aimingoo的专栏
aimingoo的专栏
腾讯CDC
T
The Blog of Author Tim Ferriss
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
量子位
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Proofpoint News Feed
博客园 - 叶小钗
宝玉的分享
宝玉的分享
雷峰网
雷峰网
Last Week in AI
Last Week in AI
B
Blog
A
About on SuperTechFans

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: clarify session runtime metadata · openclaw/openclaw...
steipete · 2026-04-29 · via Recent Commits to openclaw:main

@@ -1,4 +1,8 @@

11

import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";

2+

import {

3+

inferUniqueProviderFromConfiguredModels,

4+

isCliProvider,

5+

} from "../agents/model-selection.js";

26

import { resolveAgentModelPrimaryValue } from "../config/model-input.js";

37

import type { OpenClawConfig } from "../config/types.openclaw.js";

48

@@ -14,7 +18,9 @@ type SessionDisplayDefaults = {

1418

model: string;

1519

};

162017-

function parseModelRef(raw: string, defaultProvider: string): { provider: string; model: string } {

21+

type SessionDisplayModelRef = { provider: string; model: string };

22+23+

function parseModelRef(raw: string, defaultProvider: string): SessionDisplayModelRef {

1824

const trimmed = raw.trim();

1925

if (!trimmed) {

2026

return { provider: defaultProvider, model: DEFAULT_MODEL };

@@ -59,10 +65,7 @@ function normalizeStoredOverrideModel(params: {

5965

};

6066

}

616762-

function resolveDefaultModelRef(

63-

cfg: OpenClawConfig,

64-

agentId?: string,

65-

): { provider: string; model: string } {

68+

function resolveDefaultModelRef(cfg: OpenClawConfig, agentId?: string): SessionDisplayModelRef {

6669

const primary =

6770

resolveAgentPrimaryModel(cfg, agentId) ??

6871

resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model) ??

@@ -79,10 +82,48 @@ export function resolveSessionDisplayDefaults(

7982

};

8083

}

818485+

function normalizeCliRuntimeDisplayRef(

86+

cfg: OpenClawConfig,

87+

ref: SessionDisplayModelRef,

88+

defaultRef: SessionDisplayModelRef,

89+

): SessionDisplayModelRef {

90+

if (!isCliProvider(ref.provider, cfg)) {

91+

return ref;

92+

}

93+

if (ref.model.includes("/")) {

94+

const parsed = parseModelRef(ref.model, defaultRef.provider);

95+

if (!isCliProvider(parsed.provider, cfg)) {

96+

return parsed;

97+

}

98+

}

99+

const inferredProvider = inferUniqueProviderFromConfiguredModels({

100+

cfg,

101+

model: ref.model,

102+

});

103+

if (inferredProvider && !isCliProvider(inferredProvider, cfg)) {

104+

return { provider: inferredProvider, model: ref.model };

105+

}

106+

const parsed = parseModelRef(ref.model, defaultRef.provider);

107+

if (!isCliProvider(parsed.provider, cfg)) {

108+

return parsed;

109+

}

110+

return {

111+

provider: defaultRef.provider || ref.provider,

112+

model: parsed.model || ref.model,

113+

};

114+

}

115+82116

export function resolveSessionDisplayModel(

83117

cfg: OpenClawConfig,

84118

row: SessionDisplayModelRow,

85119

): string {

120+

return resolveSessionDisplayModelRef(cfg, row).model;

121+

}

122+123+

export function resolveSessionDisplayModelRef(

124+

cfg: OpenClawConfig,

125+

row: SessionDisplayModelRow,

126+

): SessionDisplayModelRef {

86127

const agentId = row.key.startsWith("agent:") ? row.key.split(":")[1] : undefined;

87128

const defaultRef = resolveDefaultModelRef(cfg, agentId);

88129

const normalizedOverride = normalizeStoredOverrideModel({

@@ -94,10 +135,14 @@ export function resolveSessionDisplayModel(

94135

return parseModelRef(

95136

normalizedOverride.modelOverride,

96137

normalizedOverride.providerOverride ?? defaultRef.provider,

97-

).model;

138+

);

98139

}

99140

if (row.model) {

100-

return parseModelRef(row.model, row.modelProvider ?? defaultRef.provider).model;

141+

return normalizeCliRuntimeDisplayRef(

142+

cfg,

143+

parseModelRef(row.model, row.modelProvider ?? defaultRef.provider),

144+

defaultRef,

145+

);

101146

}

102-

return defaultRef.model;

147+

return defaultRef;

103148

}