feat(media): 支持按 Provider 选择媒体模型 - #2940
Conversation
Signed-off-by: liugaowei <liugaowei@xd.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/cindy-brain/cindySlot.ts | 将 Provider-aware 媒体覆盖贯穿能力校验、执行参数和结果标签,并保留旧版裸 modelId 兼容路径。 |
| apps/desktop/src/main/cindy-brain/index.ts | 接入 Provider 媒体目录、偏好解析、执行前可用性复核及图片通道路由。 |
| apps/desktop/src/main/cindy-media/invocationService.ts | 扩展 prepare/submit 流程以支持本地 Provider 媒体调用,并在提交时重新确认来源可用性。 |
| apps/desktop/src/main/cindy-media/providerMediaRuntime.ts | 新增 Provider 媒体模型解析与运行时调用桥接。 |
| apps/desktop/src/main/cindy-brain/codexImageClient.ts | 为 OpenAI GPT Image 2 请求增加取消信号支持及脱敏诊断日志。 |
| apps/desktop/src/main/cindy-media/mediaRequestLog.ts | 提供媒体请求 URL 和参数的递归脱敏、data URL 摘要与日志安全投影。 |
| apps/desktop/src/main/model-access/mediaModels.ts | 将媒体模型发现扩展到 Provider 维度并应用当前启停配置。 |
| apps/desktop/src/renderer/cindy-brain/CindyCapabilityPrefs.tsx | 在媒体模型偏好选择器中区分同名来源并展示 Provider 图标。 |
| packages/model-providers/src/types.ts | 扩展 Provider 目录类型以声明媒体模型及其能力。 |
| packages/cindy-tools/src/ghost/mcpServer.ts | 更新 Ghost 工具契约,使媒体 prepare 请求可携带精确 Provider 选择。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
UI["Art Provider/模型选择"] --> Prefs["Ghost 媒体偏好<br/>providerId + modelId"]
Prefs --> Slot["Cindy Slot / Core prepare"]
Catalog["Gateway + 本地 Provider 目录"] --> Slot
Slot --> Check["执行前可用性复核"]
Check -->|Gateway| Gateway["Gateway 图片通道"]
Check -->|OpenAI| OpenAI["OpenAI GPT Image 2 通道"]
Gateway --> Media["生成媒体并落库"]
OpenAI --> Media
Gateway --> Log["脱敏媒体请求日志"]
OpenAI --> Log
Reviews (5): Last reviewed commit: "fix(media): reject ambiguous legacy mode..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 871ebee5fd
ℹ️ 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".
Signed-off-by: liugaowei <liugaowei@xd.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46cefa0e91
ℹ️ 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".
Signed-off-by: liugaowei <liugaowei@xd.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbedd9ef7f
ℹ️ 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".
Signed-off-by: liugaowei <liugaowei@xd.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Signed-off-by: liugaowei <liugaowei@xd.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b72faef4a
ℹ️ 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".
|
⏸️ 本 PR 触发 product 维护者确认门。 媒体生成模型支持按 Provider 选择,涉及插件基座和架构变更。 需维护者在 PR 上 Approve 后方可合并。 讨论 issue 已创建,详见上方链接。 讨论 issue:#2962 |
MagicLizi
left a comment
There was a problem hiding this comment.
✅ 审查通过:媒体模型按 providerId + modelId 复合身份选择,7 项维护者讨论条件(旧调用歧义 fail-closed、双来源端到端矩阵、诊断日志 deny-by-default + 脱敏、插件基座纯加法向后兼容、FORGE_GUIDE 已同步、PR 范围干净、UI 符合 DESIGN.md)均已在代码中核实。CI 全绿,无 P0/P1。同意合并。
|
维护者确认已通过(product / pluginBase / arch,由 magiclizi 确认),PR 恢复正常推进。 |
这次改了什么
摘要
让 Cindy 媒体能力以
providerId + modelId精确区分执行来源:同一个 GPT Image 2 同时来自 Cindy AI 和 OpenAI 时都会展示,Art 配置页用 Provider 图标区分,并把用户选择的来源原样交给 Agent/Core。新增 OpenAI Provider 的 GPT Image 2 发现与执行支持,同时在本地日志记录媒体请求的实际 URL、参数、状态和耗时;凭证、data URL 与二进制内容会脱敏或摘要。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
prepare仍兼容只传model_idUI 变化
docs/design-rules/DESIGN.md§3 Typography、§4 Select & Dropdown。保持原 300px 轻量下拉、12/13px 字体与现有颜色 token,只在条目前增加 Provider 图标,没有改成重型模型列表。怎么验证的
自动验证
手工验证
prepare,不再只按裸 model id 去重。未执行的验证
风险
风险分类
影响与回滚
provider_id时继续按历史model_id兼容路径工作,不需要重装或重新确认;要精确区分同名模型的 Provider 需使用新版 Art。提交前检查
git commit -s,见 DCO)