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

推荐订阅源

人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
Vercel News
Vercel News
D
Docker
博客园 - 聂微东
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
D
DataBreaches.Net
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
F
Fortinet All Blogs
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
N
Netflix TechBlog - Medium
G
Google Developers Blog
腾讯CDC

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-understanding): append actionable install hint ...
wangmiao0668 · 2026-06-29 · via Recent Commits to openclaw:main

@@ -7,6 +7,12 @@ import {

77

normalizeNullableString,

88

} from "@openclaw/normalization-core/string-coerce";

99

import { normalizeStringEntries } from "@openclaw/normalization-core/string-normalization";

10+

import { MediaUnderstandingSkipError } from "../../packages/media-understanding-common/src/errors.js";

11+

import { extractGeminiResponse } from "../../packages/media-understanding-common/src/output-extract.js";

12+

import {

13+

estimateBase64Size,

14+

resolveVideoMaxBase64Bytes,

15+

} from "../../packages/media-understanding-common/src/video.js";

1016

import {

1117

collectProviderApiKeysForExecution,

1218

executeWithApiKeyRotation,

@@ -19,6 +25,7 @@ import {

1925

} from "../agents/provider-request-config.js";

2026

import type { MsgContext } from "../auto-reply/templating.js";

2127

import { applyTemplate } from "../auto-reply/templating.js";

28+

import { formatCliCommand } from "../cli/command-format.js";

2229

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

2330

import type {

2431

MediaUnderstandingConfig,

@@ -29,14 +36,13 @@ import { writeExternalFileWithinRoot } from "../infra/fs-safe.js";

2936

import { resolveProxyFetchFromEnv } from "../infra/net/proxy-fetch.js";

3037

import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";

3138

import { runFfmpeg } from "../media/media-services.js";

39+

import {

40+

getOfficialExternalPluginCatalogManifest,

41+

listOfficialExternalProviderCatalogEntries,

42+

} from "../plugins/official-external-plugin-catalog.js";

43+

import { resolveOfficialExternalPluginRepairHint } from "../plugins/official-external-plugin-repair-hints.js";

3244

import { runExec } from "../process/exec.js";

3345

import { providerOperationRetryConfig } from "../provider-runtime/operation-retry.js";

34-

import { MediaUnderstandingSkipError } from "../../packages/media-understanding-common/src/errors.js";

35-

import { extractGeminiResponse } from "../../packages/media-understanding-common/src/output-extract.js";

36-

import {

37-

estimateBase64Size,

38-

resolveVideoMaxBase64Bytes,

39-

} from "../../packages/media-understanding-common/src/video.js";

4046

import { MediaAttachmentCache } from "./attachments.js";

4147

import {

4248

CLI_OUTPUT_MAX_BUFFER,

@@ -666,6 +672,53 @@ function assertMinAudioSize(params: { size: number; attachmentIndex: number }):

666672

);

667673

}

668674675+

/**

676+

* Build an actionable hint suffix for "provider not available" errors.

677+

*

678+

* Restricts the hint to ids that are owned by the official external

679+

* provider catalog — NOT the combined channel/plugin catalog — so a media

680+

* provider id like `feishu` (an official channel, not a media provider)

681+

* never emits a misleading install hint from a media-provider error.

682+

*

683+

* Tier 1: provider id is owned by an official external provider entry that

684+

* declares a `contracts.mediaUnderstandingProviders` block listing the

685+

* id — emit the catalog-backed install + registry refresh + doctor fix

686+

* commands.

687+

* Tier 2: empty string — keeps the legacy message verbatim for ids that

688+

* are not in the provider catalog (channel ids, plugin ids, unknown

689+

* ids, internal ids, etc.). Newly externalized media providers must

690+

* register with the official external provider catalog to receive the

691+

* actionable hint.

692+

*/

693+

export function formatMissingProviderHint(providerId: string): string {

694+

const trimmed = providerId.trim();

695+

if (!trimmed) {

696+

return "";

697+

}

698+

// Look up the id only in catalog entries that declare

699+

// `contracts.mediaUnderstandingProviders`. This ensures the install hint

700+

// only fires for provider packages that actually own the missing

701+

// media-understanding capability. Providers that have a generic `providers[]`

702+

// catalog entry but no media-understanding contract (e.g. Amazon Bedrock)

703+

// will not emit misleading hints.

704+

const providerEntry = listOfficialExternalProviderCatalogEntries().find((entry) => {

705+

const manifest = getOfficialExternalPluginCatalogManifest(entry);

706+

const mediaProviders = manifest?.contracts?.mediaUnderstandingProviders ?? [];

707+

return mediaProviders.some((mediaId) => mediaId === trimmed);

708+

});

709+

if (!providerEntry) {

710+

return "";

711+

}

712+

// `resolveOfficialExternalPluginRepairHint` is contract-agnostic but we

713+

// already validated ownership via the provider-only catalog, so the

714+

// returned hint is for the correct provider entry.

715+

const catalogHint = resolveOfficialExternalPluginRepairHint(trimmed);

716+

if (!catalogHint) {

717+

return "";

718+

}

719+

return ` Install the official external plugin with: ${formatCliCommand(catalogHint.installCommand)}, then run ${formatCliCommand("openclaw plugins registry --refresh")} and stop and start the gateway service, or run ${formatCliCommand(catalogHint.doctorFixCommand)} to repair automatically.`;

720+

}

721+669722

/** Executes one provider-backed media-understanding entry for one attachment. */

670723

export async function runProviderEntry(params: {

671724

capability: MediaUnderstandingCapability;

@@ -741,7 +794,9 @@ export async function runProviderEntry(params: {

741794742795

const provider = getMediaUnderstandingProvider(providerId, params.providerRegistry);

743796

if (!provider) {

744-

throw new Error(`Media provider not available: ${providerId}`);

797+

throw new Error(

798+

`Media provider not available: ${providerId}${formatMissingProviderHint(providerId)}`,

799+

);

745800

}

746801747802

// Resolve proxy-aware fetch from env vars (HTTPS_PROXY, HTTP_PROXY, etc.)