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

推荐订阅源

H
Help Net Security
腾讯CDC
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
量子位
F
Fortinet All Blogs
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
D
Docker
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
博客园 - 【当耐特】

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
chore(deadcode): drop unused helper exports · openclaw/op...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main
1-

// Media-understanding resolve tests cover timeout clamping, capability filtering,

2-

// and active-model fallback behavior.

1+

// Media-understanding resolve tests cover timeout clamping and capability filtering.

32

import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";

43

import { describe, expect, it } from "vitest";

54

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

6-

import {

7-

resolveEntriesWithActiveFallback,

8-

resolveMediaRuntimeTimeoutMs,

9-

resolveModelEntries,

10-

resolveTimeoutMs,

11-

} from "./resolve.js";

5+

import { resolveMediaRuntimeTimeoutMs, resolveModelEntries, resolveTimeoutMs } from "./resolve.js";

126

import type { MediaUnderstandingCapability } from "./types.js";

137148

const providerRegistry = new Map<string, { capabilities: MediaUnderstandingCapability[] }>([

@@ -90,88 +84,3 @@ describe("resolveModelEntries", () => {

9084

expect(entries).toHaveLength(0);

9185

});

9286

});

93-94-

describe("resolveEntriesWithActiveFallback", () => {

95-

type ResolveWithFallbackInput = Parameters<typeof resolveEntriesWithActiveFallback>[0];

96-

const defaultActiveModel = { provider: "groq", model: "whisper-large-v3" } as const;

97-98-

function resolveWithActiveFallback(params: {

99-

cfg: ResolveWithFallbackInput["cfg"];

100-

capability: ResolveWithFallbackInput["capability"];

101-

config: ResolveWithFallbackInput["config"];

102-

}) {

103-

return resolveEntriesWithActiveFallback({

104-

cfg: params.cfg,

105-

capability: params.capability,

106-

config: params.config,

107-

providerRegistry,

108-

activeModel: defaultActiveModel,

109-

});

110-

}

111-112-

function expectResolvedProviders(params: {

113-

cfg: OpenClawConfig;

114-

capability: ResolveWithFallbackInput["capability"];

115-

config: ResolveWithFallbackInput["config"];

116-

providers: string[];

117-

}) {

118-

const entries = resolveWithActiveFallback({

119-

cfg: params.cfg,

120-

capability: params.capability,

121-

config: params.config,

122-

});

123-

expect(entries).toHaveLength(params.providers.length);

124-

expect(entries.map((entry) => entry.provider)).toEqual(params.providers);

125-

}

126-127-

it("uses active model when enabled and no models are configured", () => {

128-

const cfg: OpenClawConfig = {

129-

tools: {

130-

media: {

131-

audio: { enabled: true },

132-

},

133-

},

134-

};

135-136-

expectResolvedProviders({

137-

cfg,

138-

capability: "audio",

139-

config: cfg.tools?.media?.audio,

140-

providers: ["groq"],

141-

});

142-

});

143-144-

it("ignores active model when configured entries exist", () => {

145-

const cfg: OpenClawConfig = {

146-

tools: {

147-

media: {

148-

audio: { enabled: true, models: [{ provider: "openai", model: "whisper-1" }] },

149-

},

150-

},

151-

};

152-153-

expectResolvedProviders({

154-

cfg,

155-

capability: "audio",

156-

config: cfg.tools?.media?.audio,

157-

providers: ["openai"],

158-

});

159-

});

160-161-

it("skips active model when provider lacks capability", () => {

162-

const cfg: OpenClawConfig = {

163-

tools: {

164-

media: {

165-

video: { enabled: true },

166-

},

167-

},

168-

};

169-170-

const entries = resolveWithActiveFallback({

171-

cfg,

172-

capability: "video",

173-

config: cfg.tools?.media?.video,

174-

});

175-

expect(entries).toHaveLength(0);

176-

});

177-

});