

























@@ -1,3 +1,5 @@
1+// PDF model config tests cover provider precedence and fallback model selection
2+// for PDF understanding tools.
13import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
24import type { OpenClawConfig } from "../../config/config.js";
35import { resolvePdfModelConfigForTool } from "./pdf-tool.model-config.js";
@@ -119,6 +121,8 @@ describe("resolvePdfModelConfigForTool", () => {
119121});
120122121123it("uses configured MiniMax chat models for PDF text extraction fallback", () => {
124+// MiniMax VLM models do not provide the text extraction fallback contract;
125+// choose configured chat-capable models instead.
122126vi.stubEnv("MINIMAX_API_KEY", "minimax-test");
123127const cfg = {
124128 ...withDefaultModel("openai/gpt-5.4"),
@@ -149,6 +153,8 @@ describe("resolvePdfModelConfigForTool", () => {
149153});
150154151155it("preserves generic image provider precedence when the default model is not MiniMax", () => {
156+// MiniMax remains a fallback for PDF text extraction, but should not jump
157+// ahead of an authenticated generic image/PDF provider.
152158vi.stubEnv("OPENAI_API_KEY", "openai-test");
153159vi.stubEnv("MINIMAX_API_KEY", "minimax-test");
154160const cfg = {
@@ -174,7 +180,7 @@ describe("resolvePdfModelConfigForTool", () => {
174180} as OpenClawConfig;
175181176182expect(resolvePdfModelConfigForTool({ cfg, agentDir: TEST_AGENT_DIR })).toEqual({
177-primary: "openai/gpt-5.5",
183+primary: "openai/gpt-5.4-mini",
178184fallbacks: ["minimax/MiniMax-M2.7", "minimax-portal/MiniMax-M2.7"],
179185});
180186});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。