Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

Merge remote-tracking branch 'upstream/main' into fix/core-media-video-availability

liugaowei7018b7991d54
diff --cc apps/desktop/src/main/cindy-brain/index.ts
index 5d94f33669,96de840e2f..e431592540
--- a/apps/desktop/src/main/cindy-brain/index.ts
+++ b/apps/desktop/src/main/cindy-brain/index.ts
@@@ -3442,11 -3444,16 +3444,11 @@@ function getMediaPreferenceConfig
const providers = new Map(
getActiveCatalog().providers.map((provider) => [provider.id, provider] as const),
);
- const providerModels: CindyMediaPreferenceModel[] = (kind === 'video'
- ? listLocalProviderVideoModels()
- : listProviderMediaModels())
- .filter(
- (model) =>
- model.mode === (kind === 'image' ? 'image_generation' : 'video_generation') &&
- supportsMediaCapability(model.modalities, coreCapability) &&
- (kind !== 'video' ||
- (videoRegistry?.hasAlias(model.id, model.providerId) ?? false)),
- )
+ const providerModels: CindyMediaPreferenceModel[] = selectExecutableCoreMediaModels(
- listProviderMediaModels(),
++ kind === 'video' ? listLocalProviderVideoModels() : listProviderMediaModels(),
+ kind,
+ (model) => supportsMediaCapability(model.modalities, coreCapability),
+ )
.map((model) => {
const provider = providers.get(model.providerId);
const providerName = provider?.name ?? model.providerId;
@@@ -3632,8 -3640,30 +3634,23 @@@ async function getGhostConfigurableMedi
try {
// 类型目录返回该大类所有至少有一种可执行操作的模型;具体支持动作由
// Gateway modalities 透传给插件判断,不能把插件声明的多个动作取交集。
- const availability = await listExecutableMediaModels();
- const candidates = selectExecutableCoreMediaModels(availability.models, type);
+ // The generic media-access snapshot is Gateway-first and historically only
+ // carried image-provider models. Video providers are host-owned (the video
+ // registry executes them), so add their local projection explicitly and do
+ // not let an unavailable Gateway snapshot hide an otherwise ready xAI list.
- const mode = type === 'image' ? 'image_generation' : 'video_generation';
- const videoRegistry = type === 'video' ? getVideoProviderRegistry() : null;
+ const localVideoModels = type === 'video' ? listLocalProviderVideoModels() : [];
+ const availability = await loadPluginMediaAvailability(
+ type,
+ localVideoModels.length,
+ () => listExecutableMediaModels(),
+ );
+ const allModels = [...availability.models, ...localVideoModels].filter(
+ (model, index, models) =>
+ models.findIndex(
+ (candidate) => candidate.id === model.id && candidate.providerId === model.providerId,
+ ) === index,
+ );
- const candidates = allModels.filter(
- (model) =>
- model.mode === mode &&
- (type !== 'video' ||
- (videoRegistry?.hasAlias(model.id, model.providerId) ?? false)),
- );
++ const candidates = selectExecutableCoreMediaModels(allModels, type);
const models = isProviderBlindCoreArt(ghost)
? collapseProviderBlindMediaModels(candidates, (model) => model.id)
: candidates;