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

推荐订阅源

MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
雷峰网
雷峰网
V
Visual Studio Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
IT之家
IT之家
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
月光博客
月光博客
A
About on SuperTechFans
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale

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(pdf): use MiniMax text model fallback · openclaw/open...
neeravmakwan · 2026-05-24 · via Recent Commits to openclaw:main

@@ -5,7 +5,7 @@ import {

55

resolveDefaultMediaModel,

66

} from "../../media-understanding/defaults.js";

77

import type { AuthProfileStore } from "../auth-profiles/types.js";

8-

import { isMinimaxVlmProvider } from "../minimax-vlm.js";

8+

import { isMinimaxVlmModel, isMinimaxVlmProvider } from "../minimax-vlm.js";

99

import {

1010

coerceImageModelConfig,

1111

type ImageModelConfig,

@@ -55,6 +55,78 @@ function resolveImageCandidateRefs(params: {

5555

.filter((value): value is string => Boolean(value));

5656

}

575758+

function formatProviderModelRef(providerId: string, modelId: string): string {

59+

const slash = modelId.indexOf("/");

60+

if (slash > 0 && modelId.slice(0, slash).trim() === providerId) {

61+

return modelId;

62+

}

63+

return `${providerId}/${modelId}`;

64+

}

65+66+

function isMinimaxVlmModelRef(ref: string): boolean {

67+

const slash = ref.indexOf("/");

68+

if (slash <= 0) {

69+

return false;

70+

}

71+

return isMinimaxVlmModel(ref.slice(0, slash), ref.slice(slash + 1));

72+

}

73+74+

function resolveMinimaxTextExtractionCandidateRefs(params: {

75+

cfg?: OpenClawConfig;

76+

primary: { provider: string; model: string };

77+

primaryProviderOk: boolean;

78+

agentDir: string;

79+

authStore?: AuthProfileStore;

80+

}): string[] {

81+

const candidates: string[] = [];

82+

const addCandidate = (providerId: string, modelId: string) => {

83+

const provider = providerId.trim();

84+

const model = modelId.trim();

85+

if (!provider || !model || isMinimaxVlmModel(provider, model)) {

86+

return;

87+

}

88+

const ref = formatProviderModelRef(provider, model);

89+

if (!candidates.includes(ref)) {

90+

candidates.push(ref);

91+

}

92+

};

93+94+

if (params.primaryProviderOk && isMinimaxVlmProvider(params.primary.provider)) {

95+

addCandidate(params.primary.provider, params.primary.model);

96+

}

97+98+

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

99+

if (!providers || typeof providers !== "object") {

100+

return candidates;

101+

}

102+103+

for (const [providerKey, providerCfg] of Object.entries(providers)) {

104+

const providerId = providerKey.trim();

105+

if (

106+

!providerId ||

107+

!isMinimaxVlmProvider(providerId) ||

108+

!hasAuthForProvider({

109+

provider: providerId,

110+

agentDir: params.agentDir,

111+

authStore: params.authStore,

112+

})

113+

) {

114+

continue;

115+

}

116+

const modelId = (providerCfg?.models ?? [])

117+

.find((model) => {

118+

const id = model?.id?.trim();

119+

return Boolean(id) && Array.isArray(model?.input) && model.input.includes("text");

120+

})

121+

?.id?.trim();

122+

if (modelId) {

123+

addCandidate(providerId, modelId);

124+

}

125+

}

126+127+

return candidates;

128+

}

129+58130

export function resolvePdfModelConfigForTool(params: {

59131

cfg?: OpenClawConfig;

60132

agentDir: string;

@@ -138,6 +210,13 @@ export function resolvePdfModelConfigForTool(params: {

138210

agentDir: params.agentDir,

139211

workspaceDir: params.workspaceDir,

140212

authStore: params.authStore,

213+

}).filter((ref) => !isMinimaxVlmModelRef(ref));

214+

const minimaxTextExtractionCandidates = resolveMinimaxTextExtractionCandidateRefs({

215+

cfg: params.cfg,

216+

primary,

217+

primaryProviderOk: providerOk,

218+

agentDir: params.agentDir,

219+

authStore: params.authStore,

141220

});

142221143222

if (params.cfg?.models?.providers && typeof params.cfg.models.providers === "object") {

@@ -180,11 +259,19 @@ export function resolvePdfModelConfigForTool(params: {

180259

} else if (providerOk && primarySupportsNativePdf && (providerVision || providerDefault)) {

181260

preferred = providerVision ?? `${primary.provider}/${providerDefault}`;

182261

} else {

183-

preferred = nativePdfCandidates[0] ?? genericImageCandidates[0] ?? null;

262+

preferred =

263+

nativePdfCandidates[0] ??

264+

minimaxTextExtractionCandidates[0] ??

265+

genericImageCandidates[0] ??

266+

null;

184267

}

185268186269

if (preferred?.trim()) {

187-

for (const candidate of [...nativePdfCandidates, ...genericImageCandidates]) {

270+

for (const candidate of [

271+

...nativePdfCandidates,

272+

...minimaxTextExtractionCandidates,

273+

...genericImageCandidates,

274+

]) {

188275

if (candidate !== preferred) {

189276

addFallback(candidate);

190277

}