快速结论:这个报错通常发生在 ollama launch codex-app 成功拉起 Codex App 并加载本地模型之后,一旦发送消息就触发;优先排查 Ollama 是否能解析 Codex App 传来的工具定义(namespace 类型工具)。
适用环境:Issue 已确认:macOS、Apple 芯片(GPU/CPU 均为 Apple)、Ollama 0.32.6,配合 Codex App 与 ollama launch codex-app 使用。Issue 未涉及 Python、CUDA、PyTorch 等环境信息。
最快修复方案:该 Issue 已由 PR #17630 修复,需升级到包含该修复的最新版本(评论提到当时处于 RC 阶段)。
注意事项:修复来源于 PR #17630,具体发布版本号请以你实际可获取的 Ollama 版本为准;Issue 中未给出确切的正式版本号,也未列出升级命令。若升级后问题仍在,需重新收集日志确认是否仍为工具解析失败。
问题场景
在 macOS Apple 芯片环境下,执行 ollama launch codex-app 启动 Codex App,并让其调用本地 Ollama 模型。模型能够成功加载,说明连接本身是通的;但在发送任意消息时,Ollama 在解析 Codex App 送来的工具定义阶段失败,返回 500,Codex App 端表现为 “cannot connect”。
从日志看,Codex App 会发送多个 "type": "namespace" 的工具,例如 multi_agent_v1、mcp__node_repl、mcp__openaiDeveloperDocs 等。
报错原文
ollama launch codex-app fails with Unsupported tool type: namespace when Codex App sends namespace tools
level=ERROR source=routes.go:2932 msg="chat template prompt error" error="{\"error\":{\"code\":500,\"message\":\"Failed to parse tools: Unsupported tool type: {\\\"type\\\":\\\"namespace\\\",\\\"function\\\":{\\\"name\\\":\\\"multi_agent_v1\\\",\\\"description\\\":\\\"Tools for spawning and managing sub-agents.\\\",\\\"parameters\\\":{\\\"type\\\":\\\"\\\",\\\"properties\\\":null}}}
原因分析
最可能的原因是 Ollama 当前的工具解析逻辑不认识 Codex App 发送的 namespace 类型工具,因此在生成开始前就抛出 500 错误。日志明确指向 “Failed to parse tools: Unsupported tool type …”,而模型加载阶段(llama_context、llama_kv_cache、load_model 等)均已成功,说明问题不在模型加载或网络连接,而在工具定义的兼容性处理上。
该问题已由 PR #17630 修复,说明属于 Ollama 侧对 namespace 工具类型支持缺失或解析不完整。
环境排查
- 确认 Ollama 版本:Issue 报告版本为 0.32.6,若你的版本相同或更旧,可能命中同一问题。
- 确认操作系统与硬件:Issue 为 macOS + Apple 芯片(GPU/CPU 均为 Apple)。
- 确认是否使用
ollama launch codex-app启动 Codex App,并能加载本地模型。 - 查看 Ollama 服务端日志中是否出现 “Failed to parse tools: Unsupported tool type”,以及触发该错误的具体工具名(如 multi_agent_v1、mcp__node_repl、mcp__openaiDeveloperDocs)。
- Issue 未提供 Python、CUDA、PyTorch、依赖版本等信息,如你的环境与上述不同,需单独排查。
解决步骤
- 记录当前 Ollama 版本(Issue 中为 0.32.6),确认是否早于包含 PR #17630 的版本。
- 升级到包含该修复的最新 Ollama 版本(评论指出修复已在最新 release 中,当时为 RC 阶段;请以你实际获取到的版本为准)。
- 升级后重新执行
ollama launch codex-app,让 Codex App 重新加载本地模型。 - 在 Codex App 中发送一条会触发工具调用的消息,观察是否仍返回 500 或显示 “cannot connect”。
- 如果问题仍在,重新抓取 Ollama 日志,确认是否仍为 namespace 工具解析错误,还是出现了其他工具类型或新的报错。
验证方法
升级并重启后,重复原来的操作路径:通过 ollama launch codex-app 启动 Codex App,加载本地模型并发送消息。若不再出现 “Failed to parse tools: Unsupported tool type”,且 Codex App 不再显示 “cannot connect”,同时模型能够正常生成回复或正常执行工具调用,即可认为问题已解决。
参考来源
ollama/ollama #17618
ollama/ollama PR #17630
AI 工具推荐
想把多个 AI 模型放在一个入口?
GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。
推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。
这个方案解决了吗?
可以继续搜索完整报错,或查看同一工具的其他排查指南。

![[BUG] Task output schema in the prompt marks Optional fields as required and strips null, so the model cannot express "not applicable"](https://www.chat-gpts.plus/wp-content/uploads/2026/09/6774-15a8d678-768x403.jpg)
