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

推荐订阅源

小众软件
小众软件
博客园_首页
博客园 - 聂微东
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
D
Docker
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
Jina AI
Jina AI
博客园 - Franky
D
DataBreaches.Net

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(media): prefer provider stt before local whisper · op...
steipete · 2026-04-23 · via Recent Commits to openclaw:main

@@ -4,7 +4,7 @@ import path from "node:path";

44

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

55

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

66

import { withEnvAsync } from "../test-utils/env.js";

7-

import { runCapability } from "./runner.js";

7+

import { clearMediaUnderstandingBinaryCacheForTests, runCapability } from "./runner.js";

88

import { withAudioFixture } from "./runner.test-utils.js";

99

import type { AudioTranscriptionRequest, MediaUnderstandingProvider } from "./types.js";

1010

@@ -52,6 +52,12 @@ function createOpenAiAudioCfg(extra?: Partial<OpenClawConfig>): OpenClawConfig {

5252

} as unknown as OpenClawConfig;

5353

}

545455+

async function createMockExecutable(dir: string, name: string) {

56+

const executablePath = path.join(dir, name);

57+

await fs.writeFile(executablePath, "#!/bin/sh\necho mocked-local-whisper\n", { mode: 0o755 });

58+

return executablePath;

59+

}

60+5561

async function runAutoAudioCase(params: {

5662

transcribeAudio: (req: AudioTranscriptionRequest) => Promise<{ text: string; model: string }>;

5763

cfgExtra?: Partial<OpenClawConfig>;

@@ -89,6 +95,37 @@ describe("runCapability auto audio entries", () => {

8995

expect(result.decision.outcome).toBe("success");

9096

});

919798+

it("prefers provider keys over auto-detected local whisper", async () => {

99+

const binDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-auto-audio-bin-"));

100+

try {

101+

await createMockExecutable(binDir, "whisper");

102+

clearMediaUnderstandingBinaryCacheForTests();

103+

let seenModel: string | undefined;

104+

const result = await withEnvAsync(

105+

{

106+

PATH: binDir,

107+

SHERPA_ONNX_MODEL_DIR: undefined,

108+

WHISPER_CPP_MODEL: undefined,

109+

GEMINI_API_KEY: undefined,

110+

},

111+

async () =>

112+

await runAutoAudioCase({

113+

transcribeAudio: async (req) => {

114+

seenModel = req.model;

115+

return { text: "provider transcription", model: req.model ?? "unknown" };

116+

},

117+

}),

118+

);

119+120+

expect(result.outputs[0]?.provider).toBe("openai");

121+

expect(result.outputs[0]?.text).toBe("provider transcription");

122+

expect(seenModel).toBe("gpt-4o-transcribe");

123+

} finally {

124+

clearMediaUnderstandingBinaryCacheForTests();

125+

await fs.rm(binDir, { recursive: true, force: true });

126+

}

127+

});

128+92129

it("skips auto audio when disabled", async () => {

93130

const result = await runAutoAudioCase({

94131

transcribeAudio: async () => ({