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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
WordPress大学
WordPress大学
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
I
InfoQ
小众软件
小众软件
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
美团技术团队
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
V
V2EX
J
Java Code Geeks
有赞技术团队
有赞技术团队
博客园 - 聂微东
B
Blog RSS Feed
博客园 - 司徒正美

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: surface async media generation failures · openclaw/o...
steipete · 2026-05-17 · via Recent Commits to openclaw:main

@@ -4,14 +4,18 @@ import type { OpenClawConfig } from "../../config/types.openclaw.js";

44

import { clearAgentRunContext, registerAgentRunContext } from "../../infra/agent-events.js";

55

import { formatErrorMessage } from "../../infra/errors.js";

66

import { createSubsystemLogger } from "../../logging/subsystem.js";

7+

import { resolveAgentIdFromSessionKey } from "../../routing/session-key.js";

78

import {

89

completeTaskRunByRunId,

910

createRunningTaskRun,

1011

failTaskRunByRunId,

1112

recordTaskRunProgressByRunId,

1213

} from "../../tasks/detached-task-runtime.js";

13-

import type { DeliveryContext } from "../../utils/delivery-context.js";

14-

import { INTERNAL_MESSAGE_CHANNEL } from "../../utils/message-channel.js";

14+

import { normalizeDeliveryContext, type DeliveryContext } from "../../utils/delivery-context.js";

15+

import {

16+

INTERNAL_MESSAGE_CHANNEL,

17+

isDeliverableMessageChannel,

18+

} from "../../utils/message-channel.js";

1519

import {

1620

mediaUrlsFromGeneratedAttachments,

1721

type AgentGeneratedAttachment,

@@ -447,7 +451,22 @@ async function wakeMediaGenerationTaskCompletion(params: {

447451

bestEffortDeliver: true,

448452

directIdempotencyKey: announceId,

449453

});

450-

if (!delivery.delivered && delivery.error) {

454+

if (delivery.delivered) {

455+

return;

456+

}

457+

if (params.status === "error") {

458+

const delivered = await tryDeliverMediaGenerationFailureDirect({

459+

config: params.config,

460+

handle: params.handle,

461+

toolName: params.toolName,

462+

completionLabel: params.completionLabel,

463+

result: params.result,

464+

});

465+

if (delivered) {

466+

return;

467+

}

468+

}

469+

if (delivery.error) {

451470

log.error("Media generation completion wake failed; requester session was not woken", {

452471

taskId: params.handle.taskId,

453472

runId: params.handle.runId,

@@ -457,6 +476,50 @@ async function wakeMediaGenerationTaskCompletion(params: {

457476

}

458477

}

459478479+

async function tryDeliverMediaGenerationFailureDirect(params: {

480+

config?: OpenClawConfig;

481+

handle: MediaGenerationTaskHandle;

482+

toolName: string;

483+

completionLabel: string;

484+

result: string;

485+

}): Promise<boolean> {

486+

const origin = normalizeDeliveryContext(params.handle.requesterOrigin);

487+

if (!origin?.channel || !origin.to || !isDeliverableMessageChannel(origin.channel)) {

488+

return false;

489+

}

490+

const label = `${params.completionLabel[0]?.toUpperCase() ?? "M"}${params.completionLabel.slice(1)}`;

491+

const agentId = resolveAgentIdFromSessionKey(params.handle.requesterSessionKey);

492+

const idempotencyKey = `${params.toolName}:${params.handle.taskId}:error:direct`;

493+

try {

494+

const { sendMessage } = await import("../../tasks/task-registry-delivery-runtime.js");

495+

await sendMessage({

496+

cfg: params.config,

497+

channel: origin.channel,

498+

to: origin.to,

499+

accountId: origin.accountId,

500+

threadId: origin.threadId,

501+

content: `${label} generation failed: ${params.result}`,

502+

requesterSessionKey: params.handle.requesterSessionKey,

503+

agentId,

504+

idempotencyKey,

505+

mirror: {

506+

sessionKey: params.handle.requesterSessionKey,

507+

agentId,

508+

idempotencyKey,

509+

},

510+

});

511+

return true;

512+

} catch (error) {

513+

log.warn("Direct media generation failure delivery failed; falling back to agent wake", {

514+

taskId: params.handle.taskId,

515+

runId: params.handle.runId,

516+

toolName: params.toolName,

517+

error,

518+

});

519+

return false;

520+

}

521+

}

522+460523

export function createMediaGenerationTaskLifecycle(params: {

461524

toolName: string;

462525

taskKind: string;