Skip to content

fix(media): 修复 Core 视频模型被旧 Registry 误过滤 - #3452

Open
GaoWeiLiuXD wants to merge 5 commits into
makecindy:mainfrom
GaoWeiLiuXD:fix/core-media-video-availability
Open

fix(media): 修复 Core 视频模型被旧 Registry 误过滤#3452
GaoWeiLiuXD wants to merge 5 commits into
makecindy:mainfrom
GaoWeiLiuXD:fix/core-media-video-availability

Conversation

@GaoWeiLiuXD

@GaoWeiLiuXD GaoWeiLiuXD commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

这次改了什么

摘要

Gateway 视频模型已有 modalities 与 Guide 可执行性预检,但 Core 媒体偏好和插件目录又按旧 VideoProviderRegistry 过滤,导致无 legacy alias 的可用模型被隐藏。本 PR 去掉这层重复过滤,并隔离旧 cindy-request 的偏好解析。

变更类型

  • feat 新功能
  • fix 缺陷修复
  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护
  • 其他:

范围

  • 关联 Issue / 需求:Core 媒体模型可用性修复
  • 本 PR 包含:移除 Gateway Core 视频在媒体偏好、插件目录中的 legacy alias 二次过滤;旧 cindy-request 读取视频偏好时按实际执行通道筛选,复用既有失效配置恢复与持久化;补充相关行为测试。
  • 明确不包含:Server、Guide、Art 插件、Gateway 元数据、新增第三方视频执行通道;不改旧 cindy-request 的生成协议或 Registry 派发防线。
  • 用户可见变化:通过 Guide 预检的视频不再因缺少 legacy alias 而从 Core/Art 列表消失。旧插件遇到它无法执行的已保存选型时,若有旧通道可执行候选,则自动恢复到可用选型并写回原配置,不只在运行时静默换模型。
  • 是否存在 breaking change:无。
  • 第三方本地视频仍使用 Registry 执行,listLocalProviderVideoModels() 的 alias 检查保持不变;Gateway Core 视频不经过该函数。当前第三方 Provider Core runtime 仅注册图片能力,不把尚未接通的第三方视频冒充为可用模型。

已确认的兼容策略

需求已明确:由于版本兼容导致当前插件无法执行保存的模型时,只要还有可执行候选,就自动恢复到可用选型;此恢复属于用户配置的兼容性更新,不要求用户重新配置。恢复后的 Provider + 模型写回原配置并记录迁移日志,后续配置读取与实际使用保持一致;不采用“执行时换模型、保存的配置仍指向另一模型”的分离口径。仍可执行的选择不改,无旧通道候选时不改写配置,也不绕过 Registry 发请求。

UI 变化

不涉及:没有修改 UI 代码,仅修正模型目录及旧执行入口的配置解析。

  • 引用的设计规范:不涉及。

怎么验证的

自动验证

  • 当前修复提交前 pnpm --filter desktop run --if-present typecheck 通过。
  • pnpm test:unit:related 通过,实际范围为本 PR 的 3 个 Desktop 文件,耗时约 32 秒,未退化为全量测试。
  • 回归覆盖:Core 可执行但无 legacy alias 的视频仍保留;旧入口按精确 Provider + 模型筛选并恢复失效默认;仍有效的默认不变;空候选不伪造选型;Core 原目录不被修改。
  • 已按 code-review 复核完整 PR diff 及调用链:旧入口筛选结果传入既有 resolveAndMigrateGhostMediaPreference,配置变更继续写入同一 writeGhostCindyOverride 存储。

手工验证

本轮未启动 Desktop,未发起真实付费生成。

未执行的验证

本地未重跑全量单测或 Windows 实机;GitHub CI 负责 Linux/Windows 完整单测。纯目录筛选与现有持久化调用未新增平台相关行为。

风险

风险分类

  • 无已知风险
  • SQLite / migration
  • system prompt
  • 协议兼容
  • 权限 / 安全 / 用户数据
  • 存量插件兼容(批准状态 / 指纹 / manifest 校验 / 安装布局 / 包格式)
  • 原生层 / fingerprint / OTA
  • 跨平台差异
  • 其他:

影响与回滚

  • 影响范围:Core 媒体偏好、插件媒体目录,以及旧 cindy-request 的视频偏好恢复。
  • 仍有效的 Provider + 模型配置保持不变;旧通道无法执行的选型复用原有配置恢复机制,不增加第二份配置或状态机。旧通道没有可执行候选时仍不能生成,不绕过执行校验。
  • 不改变批准记录、权限、凭证、安装布局;无需重新安装或重新授权插件。
  • 回滚 / 降级方式:回滚本 PR;偏好存储格式未变,恢复后的值仍为既有格式。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名(git commit -s
  • UI 改动已在「UI 变化」注明引用的设计规范(不涉及 UI)
  • 未提交凭证、令牌或授权文件
  • 已补充必要文档(PR 说明中明确 Core 与第三方本地视频边界)
  • 已确认测试结果或说明未执行原因

Signed-off-by: liugaowei <liugaowei@xd.com>
@GaoWeiLiuXD
GaoWeiLiuXD requested a review from a team as a code owner August 26, 2026 08:52
@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Greptile Summary

本 PR 将 Gateway Core 媒体目录的可执行性判断与旧视频 Registry alias 解耦,并在旧 cindy-request 读取视频偏好时单独筛选其可执行候选、复用现有迁移机制持久化回退结果。

  • 新增统一的 Core 媒体类型与可执行性筛选辅助函数
  • 移除 Core 媒体偏好及插件目录中的重复 legacy alias 过滤
  • 为旧 cindy-request 增加按 Provider 与模型筛选及默认值恢复
  • 补充媒体目录和旧偏好筛选测试

Confidence Score: 5/5

该 PR 看起来可以安全合并。

未发现仍会阻塞合并的功能或安全故障。

Important Files Changed

Filename Overview
apps/desktop/src/main/cindy-brain/cindyMediaCatalog.ts 新增 Core 媒体模型筛选和旧执行通道配置收窄辅助函数,保持输入目录不可变。
apps/desktop/src/main/cindy-brain/index.ts Core 目录不再依赖 legacy alias,可执行性筛选与旧 cindy-request 偏好恢复被拆分到各自通道。
apps/desktop/src/main/cindy-brain/tests/cindyMediaCatalog.test.ts 增加 Core 视频筛选和旧配置默认值恢复的单元测试。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Gateway 与本地媒体模型] --> B[Core 类型及可执行性筛选]
  B --> C[Core 媒体偏好与插件目录]
  C --> D[Core 执行通道]
  C --> E[旧 cindy-request 读取]
  E --> F[Legacy Registry alias 筛选]
  F --> G[失效默认恢复与持久化]
  G --> H[旧 Registry 执行通道]
Loading

Reviews (5): Last reviewed commit: "fix(media): reconcile legacy video prefe..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9526534908

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/cindy-brain/index.ts Outdated
Signed-off-by: liugaowei <liugaowei@xd.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43f9e0f792

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/cindy-brain/cindySlot.ts Outdated
@GaoWeiLiuXD

Copy link
Copy Markdown
Collaborator Author

@greptileai review the current head 43f9e0f7927e0d0babbdeaf8310750d18bf50b9e.

Signed-off-by: liugaowei <liugaowei@xd.com>
@GaoWeiLiuXD

Copy link
Copy Markdown
Collaborator Author

@greptileai review the current head e7a5084.

@GaoWeiLiuXD

Copy link
Copy Markdown
Collaborator Author

@codex review the current head e7a5084.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@MagicLizi MagicLizi added touches:plugin-base 改动碰到插件基座(review-pr 自动维护,仅展示) awaiting-discussion 等待维护者讨论(review-pr) labels Aug 26, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

这个 PR 改到了插件基座(cindy-brain 媒体目录与入口),已挂维护者确认,等维护者在 PR 上 Approve 后才会继续落地。

需要改的话请直接 Request Changes;作者改完再 Approve 即可。讨论细节写在关联的讨论 issue 里。

讨论 issue:#3457

@MagicLizi

Copy link
Copy Markdown
Contributor

@GaoWeiLiuXD 👋 这个 PR 目前与 main 有合并冲突,auto-review 因此暂时跳过、没法继续审查 / 合并。

请在本地 merge 最新的 origin/main 解决冲突后推送;冲突解除后,下一轮 auto-review 会自动重新处理这个 PR。

…o-availability

Signed-off-by: liugaowei <liugaowei@xd.com>

# Conflicts:
#	apps/desktop/src/main/cindy-brain/index.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7018b7991d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/cindy-brain/index.ts
@MagicLizi

Copy link
Copy Markdown
Contributor

@GaoWeiLiuXD 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/cindy-brain/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@GaoWeiLiuXD

Copy link
Copy Markdown
Collaborator Author

@greptileai review the current head 7018b79.

Comment thread apps/desktop/src/main/cindy-brain/index.ts
@GaoWeiLiuXD

Copy link
Copy Markdown
Collaborator Author

@greptileai review the current head 4897117. 本轮仅修复旧 cindy-request 的视频偏好恢复,Core Gateway 目录不再按 legacy alias 过滤;第三方本地视频仍由 Registry 执行,边界已在 PR 正文及上轮 thread 说明。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48971177a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/cindy-brain/index.ts
@MagicLizi MagicLizi added the touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-discussion 等待维护者讨论(review-pr) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:plugin-base 改动碰到插件基座(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants