fix(desktop): route XD Grok through Chat bridge - #2487
Conversation
Signed-off-by: tiammomo <pearfl@qq.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-host/active-catalog.ts | 为动态发现的 XD Grok Codex 模型增加 openai-chat 兼容协议标记。 |
| apps/desktop/src/main/maker-host/provider-route.ts | 根据目录模型的兼容协议选择具体路由,同时保留既有 XD Claude Anthropic 桥接逻辑。 |
| apps/desktop/src/main/maker-host/codex-proxy-host.ts | 为 XD Gateway Chat 桥接注入正确上游与凭证,并清理 Grok 不支持的禁用搜索声明。 |
| apps/desktop/src/main/maker-host/tests/codexProxyHost.test.ts | 覆盖 XD Grok 显式和隐式路由、工具保留、凭证缺失回退以及非 Grok 原生 Responses 路径。 |
| apps/desktop/src/main/maker-host/tests/activeCatalogXdAvailability.test.ts | 验证 XD Grok Codex 模型被标记为 openai-chat 兼容协议。 |
Sequence Diagram
sequenceDiagram
participant Codex
participant Proxy as Desktop Codex Proxy
participant Router as Provider Router
participant Bridge as Responses-to-Chat Bridge
participant XD as XD Gateway
Codex->>Proxy: "Responses 请求(x-ai/grok-*)"
Proxy->>Router: 解析会话提供商与兼容协议
Router-->>Proxy: XD + openai-chat + gateway-key
Proxy->>Proxy: 移除禁用的 web_search 并清理工具元数据
Proxy->>Bridge: 转换 Responses 请求
Bridge->>XD: Chat Completions 请求 + Gateway 凭证
XD-->>Bridge: 模型响应
Bridge-->>Codex: Responses 兼容响应
Reviews (3): Last reviewed commit: "fix(desktop): route XD Grok through Chat..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76829970f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: tiammomo <pearfl@qq.com>
|
@tiammomo 👋 这个 PR 还有 2 条 review conversation 没 resolve(apps/desktop/src/main/maker-host/codex-proxy-host.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
@tiammomo 嗨咯,当前的处理方式会把所有插件能力都丢了,没法用插件了,是否考虑走 Chat bridge 的方式解决? |
|
👋 此 PR 命中 Arch 维护者确认门(核心路径改动 247 行 ≥ 150)。 请维护者(@makecindy/maintainers)确认后直接在 PR 上 Approve 即可放行;如需修改请 Request Changes,作者改完后重新 Approve。 讨论 issue:#2490 |
Signed-off-by: tiammomo <pearfl@qq.com>
|
Thanks for catching this. I replaced the tool-filtering approach with the existing Responses-to-Chat bridge. Namespace, custom, and tool-search adapters are now preserved for both explicit and implicit XD Gateway Grok routes. The focused 214-test route suite, 90 Chat bridge tests, full unit suite, Desktop typecheck, and DCO pass. |
这次改了什么
摘要
Route XD Gateway Grok models through Cindy's Responses-to-Chat bridge so Codex plugin tools remain available.
变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
x-ai/grok-*models for the existing Chat bridge, preserve namespace/custom/tool-search adapters, inject Gateway credentials, and cover explicit and implicit routes.namespaceschema.Remote and mobile adaptation
UI 变化
Not applicable. No visual, layout, copy, or interaction change.
怎么验证的
自动验证
手工验证
Not run.
未执行的验证
Real XD Gateway and Windows smoke tests were not run.
风险
风险分类
影响与回滚
x-ai/grok-*Codex requests switch from native Responses forwarding to the existing Chat bridge.提交前检查
git commit -s,见 DCO)