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

推荐订阅源

H
Help Net Security
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
V
Visual Studio Blog
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
Vercel News
Vercel News
F
Fortinet All Blogs
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
小众软件
小众软件
月光博客
月光博客
A
About on SuperTechFans

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
docs: document media generation tests · openclaw/openclaw...
steipete · 2026-06-05 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// Image generation background tests cover detached task creation, progress

2+

// updates, and completion wake delivery for generated image results.

13

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

24

import { IMAGE_GENERATION_TASK_KIND } from "../image-generation-task-status.js";

35

import {

@@ -78,6 +80,8 @@ describe("image generate background helpers", () => {

7880

});

7981
8082

it("queues a completion event through the shared generated-media wake path", async () => {

83+

// Successful media completion is routed through the announce handoff so the

84+

// requesting session receives model-mediated visible reply instructions.

8185

announceDeliveryMocks.deliverSubagentAnnouncement.mockResolvedValue({

8286

delivered: true,

8387

path: "direct",

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// image_generate tool tests cover provider/model selection, edit inputs,

2+

// background task handling, media saving, and duplicate-generation guards.

13

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

24
35

const taskRuntimeInternalMocks = vi.hoisted(() => {

@@ -212,6 +214,8 @@ function createToolWithPrimaryImageModel(

212214

}

213215
214216

function stubEditedImageFlow(params?: { width?: number; height?: number }) {

217+

// Edit tests stub the whole media pipeline so assertions focus on tool input

218+

// shaping, provider choice, and saved-media metadata.

215219

const generateImage = vi.spyOn(imageGenerationRuntime, "generateImage").mockResolvedValue({

216220

provider: "google",

217221

model: "gemini-3-pro-image-preview",

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// Media generation background test support centralizes task/announcement mocks

2+

// and assertions shared by image, video, and music generation tests.

13

import { expect, vi } from "vitest";

24
35

type MockWithReset = {

@@ -204,6 +206,8 @@ export function expectFallbackMediaAnnouncement({

204206

resultMediaPath,

205207

mediaUrls,

206208

}: FallbackAnnouncementExpectation): void {

209+

// Fallback announcements are agent-mediated completions: internal events must

210+

// carry media URLs and a visible-reply instruction for the completion agent.

207211

expect(deliverAnnouncementMock).toHaveBeenCalledTimes(1);

208212

const params = requireMockFirstParam(

209213

deliverAnnouncementMock,

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// Video generation background tests cover detached task lifecycle, keepalive

2+

// progress, completion announcement, and direct failure delivery.

13

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

24

import { getAgentRunContext, resetAgentRunContextForTest } from "../../infra/agent-events.js";

35

import { VIDEO_GENERATION_TASK_KIND } from "../video-generation-task-status.js";

@@ -117,6 +119,8 @@ describe("video generate background helpers", () => {

117119

});

118120
119121

it("keeps long-running media tasks fresh while provider work is pending", async () => {

122+

// Provider video generation can outlive normal activity windows; keepalive

123+

// progress prevents the detached task from looking stale while it waits.

120124

vi.useFakeTimers();

121125

let resolveRun: ((value: string) => void) | undefined;

122126

const runPromise = new Promise<string>((resolve) => {

Original file line numberDiff line numberDiff line change

@@ -1,3 +1,5 @@

1+

// video_generate tool tests cover provider/model selection, plugin metadata,

2+

// background task handling, input media, and saved video output.

13

import { MAX_VIDEO_BYTES } from "@openclaw/media-core/constants";

24

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

35

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

@@ -141,6 +143,8 @@ function createVideoProviderSnapshot(params: {

141143

referenceAudioInputs?: boolean;

142144

workspaceDir?: string;

143145

}): PluginMetadataSnapshot {

146+

// Plugin-backed provider snapshots are synthesized here so tool behavior can

147+

// be tested without loading plugin manifests from disk.

144148

const policyHash = resolveInstalledPluginIndexPolicyHash(params.config);

145149

const plugin: PluginManifestRecord = {

146150

id: params.id,