Codex + 网关版 Grok 4.5 因工具格式不兼容请求失败
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: zhaotianyi
**客户端版本**: 0.1.38
---
## 问题描述
使用 Codex 引擎搭配网关版 Grok 4.5(模型标识 `x-ai/grok-4.5`)时,第一次发送任务会失败;切换到 Claude Code 后,使用同一个模型和同一任务可以成功执行。
## 复现步骤
1. 选择 Codex 引擎。
2. 选择 Grok 4.5 网关模型 `x-ai/grok-4.5`。
3. 发送一个需要使用工具的任务,例如拉取 GitHub 项目源代码。
4. 观察请求失败,并反复显示 `Reconnecting... 1/5` 到 `5/5`。
## 实际结果
请求返回 HTTP 422,错误内容类似:
```text
unknown variant `namespace`, expected one of `function`, `web_search`, `x_search`, ...
```
Codex 的请求中包含了 Grok 不支持的 `type: "namespace"` 工具声明。Cindy 当前的兼容处理似乎只覆盖直连 xAI provider(`xai/*`),没有覆盖网关 provider 下的 `x-ai/*` 模型,因此不兼容的工具格式被直接转发给 Grok。
同一任务切换到 Claude Code 后可以正常完成,说明 GitHub 地址、项目权限和模型本身并无明显问题。
## 期望结果
Cindy 应在 Codex 请求发送到网关版 Grok 4.5 前,正确过滤或转换 Grok 不支持的工具类型(特别是 `namespace`),使 Codex + `x-ai/grok-4.5` 能够正常执行工具调用,而不是重复发送同一个无效请求。
建议增加 Codex + XD Gateway + `x-ai/grok-4.5` 的回归测试。
---
**版本区域**: CN
**OS**: win32 x64 (10.0.22621)
**界面语言**: zh-CN
Contributor guide
Research direction
Trace the Codex request path and the existing provider compatibility handling for direct xAI models versus gateway `x-ai/*` models. Reproduce the HTTP 422 with `x-ai/grok-4.5`, then add the suggested Codex + XD Gateway regression test and verify unsupported tool declarations no longer cause repeated reconnects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, backend-api-design, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100