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

推荐订阅源

月光博客
月光博客
云风的 BLOG
云风的 BLOG
小众软件
小众软件
雷峰网
雷峰网
博客园 - 【当耐特】
V
V2EX
WordPress大学
WordPress大学
IT之家
IT之家
Last Week in AI
Last Week in AI
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
The Cloudflare Blog
Jina AI
Jina AI
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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: keep media provider inventory internal (#75550) · op...
MkDev11 · 2026-05-03 · via Recent Commits to openclaw:main

@@ -142,6 +142,44 @@ async function handleCaseVariantBuiltinMedia(mediaPathOrUrl: string) {

142142

return ctx;

143143

}

144144145+

const providerInventoryText = [

146+

"openai: default=sora-2 | models=sora-2",

147+

"google: default=veo-3.1-fast-generate-preview | models=veo-3.1-fast-generate-preview",

148+

].join("\n");

149+150+

async function handleProviderInventoryListResult(params: {

151+

toolName: "image_generate" | "video_generate";

152+

shouldEmitToolOutput: boolean;

153+

}) {

154+

const ctx = createMockContext({

155+

shouldEmitToolOutput: params.shouldEmitToolOutput,

156+

onToolResult: vi.fn(),

157+

toolResultFormat: "plain",

158+

});

159+160+

await handleToolExecutionEnd(ctx, {

161+

type: "tool_execution_end",

162+

toolName: params.toolName,

163+

toolCallId: "tc-1",

164+

isError: false,

165+

result: {

166+

content: [{ type: "text", text: providerInventoryText }],

167+

details: {

168+

providers: [

169+

{ id: "openai", defaultModel: "sora-2", models: ["sora-2"] },

170+

{

171+

id: "google",

172+

defaultModel: "veo-3.1-fast-generate-preview",

173+

models: ["veo-3.1-fast-generate-preview"],

174+

},

175+

],

176+

},

177+

},

178+

});

179+180+

return ctx;

181+

}

182+145183

describe("handleToolExecutionEnd media emission", () => {

146184

it("does not warn for read tool when path is provided via file_path alias", async () => {

147185

const ctx = createMockContext();

@@ -424,52 +462,36 @@ describe("handleToolExecutionEnd media emission", () => {

424462

expect(ctx.state.pendingToolMediaUrls).toEqual(["/tmp/generated.png"]);

425463

});

426464427-

it("emits provider inventory output for compact video_generate list results", async () => {

428-

const ctx = createMockContext({

429-

shouldEmitToolOutput: false,

430-

onToolResult: vi.fn(),

431-

toolResultFormat: "plain",

432-

});

433-434-

await handleToolExecutionEnd(ctx, {

435-

type: "tool_execution_end",

436-

toolName: "video_generate",

437-

toolCallId: "tc-1",

438-

isError: false,

439-

result: {

440-

content: [

441-

{

442-

type: "text",

443-

text: [

444-

"openai: default=sora-2 | models=sora-2",

445-

"google: default=veo-3.1-fast-generate-preview | models=veo-3.1-fast-generate-preview",

446-

].join("\n"),

447-

},

448-

],

449-

details: {

450-

providers: [

451-

{ id: "openai", defaultModel: "sora-2", models: ["sora-2"] },

452-

{

453-

id: "google",

454-

defaultModel: "veo-3.1-fast-generate-preview",

455-

models: ["veo-3.1-fast-generate-preview"],

456-

},

457-

],

458-

},

459-

},

460-

});

465+

it.each(["image_generate", "video_generate"] as const)(

466+

"keeps %s provider inventory internal when tool output is hidden",

467+

async (toolName) => {

468+

const ctx = await handleProviderInventoryListResult({

469+

toolName,

470+

shouldEmitToolOutput: false,

471+

});

461472462-

expect(ctx.emitToolOutput).toHaveBeenCalledWith(

463-

"video_generate",

464-

undefined,

465-

[

466-

"openai: default=sora-2 | models=sora-2",

467-

"google: default=veo-3.1-fast-generate-preview | models=veo-3.1-fast-generate-preview",

468-

].join("\n"),

469-

expect.any(Object),

470-

);

471-

expect(ctx.state.pendingToolMediaUrls).toEqual([]);

472-

});

473+

expect(ctx.emitToolOutput).not.toHaveBeenCalled();

474+

expect(ctx.state.pendingToolMediaUrls).toEqual([]);

475+

},

476+

);

477+478+

it.each(["image_generate", "video_generate"] as const)(

479+

"emits %s provider inventory when verbose tool output is enabled",

480+

async (toolName) => {

481+

const ctx = await handleProviderInventoryListResult({

482+

toolName,

483+

shouldEmitToolOutput: true,

484+

});

485+486+

expect(ctx.emitToolOutput).toHaveBeenCalledWith(

487+

toolName,

488+

undefined,

489+

providerInventoryText,

490+

expect.any(Object),

491+

);

492+

expect(ctx.state.pendingToolMediaUrls).toEqual([]);

493+

},

494+

);

473495474496

it("does NOT emit media for error results", async () => {

475497

const onToolResult = vi.fn();