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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MongoDB | Blog
MongoDB | Blog
博客园_首页
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
B
Blog RSS Feed
D
Docker
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
V
V2EX
量子位
雷峰网
雷峰网
月光博客
月光博客
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog

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: repair model media probes · openclaw/openclaw@e07febd
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -6,32 +6,22 @@ import {

66

requireApiKey,

77

resolveApiKeyForProvider,

88

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

9-

import { findNormalizedProviderValue, normalizeModelRef } from "../agents/model-selection.js";

9+

import { normalizeModelRef } from "../agents/model-selection.js";

1010

import { ensureOpenClawModelsJson } from "../agents/models-config.js";

11-

import { resolveModelWithRegistry } from "../agents/pi-embedded-runner/model.js";

11+

import { resolveModelAsync } from "../agents/pi-embedded-runner/model.js";

1212

import { resolveProviderRequestCapabilities } from "../agents/provider-attribution.js";

1313

import { registerProviderStreamForModel } from "../agents/provider-stream.js";

1414

import {

1515

coerceImageAssistantText,

1616

hasImageReasoningOnlyResponse,

1717

} from "../agents/tools/image-tool.helpers.js";

18-

import { prepareProviderDynamicModel } from "../plugins/provider-runtime.js";

1918

import type {

2019

ImageDescriptionRequest,

2120

ImageDescriptionResult,

2221

ImagesDescriptionRequest,

2322

ImagesDescriptionResult,

2423

} from "./types.js";

252426-

let piModelDiscoveryRuntimePromise: Promise<

27-

typeof import("../agents/pi-model-discovery-runtime.js")

28-

> | null = null;

29-30-

function loadPiModelDiscoveryRuntime() {

31-

piModelDiscoveryRuntimePromise ??= import("../agents/pi-model-discovery-runtime.js");

32-

return piModelDiscoveryRuntimePromise;

33-

}

34-3525

function resolveImageToolMaxTokens(modelMaxTokens: number | undefined, requestedMaxTokens = 4096) {

3626

if (

3727

typeof modelMaxTokens !== "number" ||

@@ -143,48 +133,17 @@ async function resolveImageRuntime(params: {

143133

authStore?: ImageDescriptionRequest["authStore"];

144134

}): Promise<{ apiKey: string; model: Model<Api> }> {

145135

await ensureOpenClawModelsJson(params.cfg, params.agentDir);

146-

const { discoverAuthStorage, discoverModels } = await loadPiModelDiscoveryRuntime();

147-

const authStorage = discoverAuthStorage(params.agentDir);

148-

const modelRegistry = discoverModels(authStorage, params.agentDir);

149136

const resolvedRef = normalizeModelRef(params.provider, params.model);

150-

const configuredProviders = params.cfg.models?.providers;

151-

const providerConfig =

152-

configuredProviders?.[resolvedRef.provider] ??

153-

findNormalizedProviderValue(configuredProviders, resolvedRef.provider);

154-

// Fast path: resolve without dynamic model preparation first.

155-

// This avoids unnecessary prepare hooks (e.g. OpenRouter catalog fetch)

156-

// for models that are already explicitly resolvable.

157-

let model = resolveModelWithRegistry({

158-

provider: resolvedRef.provider,

159-

modelId: resolvedRef.model,

160-

modelRegistry,

161-

cfg: params.cfg,

162-

agentDir: params.agentDir,

163-

}) as Model<Api> | null;

164-165-

// If the model is not in the registry yet, prepare dynamic provider models

166-

// and retry (needed for provider-runtime-backed dynamic models).

167-

if (!model) {

168-

await prepareProviderDynamicModel({

169-

provider: resolvedRef.provider,

170-

config: params.cfg,

171-

context: {

172-

config: params.cfg,

173-

agentDir: params.agentDir,

174-

provider: resolvedRef.provider,

175-

modelId: resolvedRef.model,

176-

modelRegistry,

177-

providerConfig,

178-

},

179-

});

180-

model = resolveModelWithRegistry({

181-

provider: resolvedRef.provider,

182-

modelId: resolvedRef.model,

183-

modelRegistry,

184-

cfg: params.cfg,

185-

agentDir: params.agentDir,

186-

}) as Model<Api> | null;

187-

}

137+

const resolved = await resolveModelAsync(

138+

resolvedRef.provider,

139+

resolvedRef.model,

140+

params.agentDir,

141+

params.cfg,

142+

{

143+

allowBundledStaticCatalogFallback: true,

144+

},

145+

);

146+

const { authStorage, model } = resolved;

188147

if (!model) {

189148

throw new Error(`Unknown model: ${resolvedRef.provider}/${resolvedRef.model}`);

190149

}