<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[我把codex接入了mimo token plan，但是codex不能完整独立完成任务]]></title><description><![CDATA[<p dir="auto">我把codex接入了mimo token plan，但是codex不能完整完成任务，总是输出以下似乎是调用工具的内容后截断。大佬们，求个解决方案。</p>
<p dir="auto">&lt;tool_call&gt;<br />
function_calls&gt;<br />
&lt;tool_call&gt;<br />
{"name": "exec_command", "arguments": {"cmd": "&amp; "E:\ai-toolkit\venv\Scripts\python.exe" -c "\ncontent = open(r'E:\laya\backend_simple.py', 'r', encoding='utf-8').read()\n# Replace capture_screen method with fallback\nold = '''    def capture_screen(self, region=None):\n        if region is None:\n            monitor = self.sct.monitors[1]\n            region = {\"top\": monitor[\"top\"], \"left\": monitor[\"left\"],\n                      \"width\": monitor[\"width\"], \"height\": monitor[\"height\"]}\n        screenshot = self.sct.grab(region)\n        return Image.frombytes(\"RGB\", screenshot.size, screenshot.rgb)'''\nnew = '''    def capture_screen(self, region=None):\n        try:\n            if region is None:\n                monitor = self.sct.monitors[1]\n                region = {\"top\": monitor[\"top\"], \"left\": monitor[\"left\"],\n                          \"width\": monitor[\"width\"], \"height\": monitor[\"height\"]}\n            screenshot = self.sct.grab(region)\n            return Image.frombytes(\"RGB\", screenshot.size, screenshot.rgb)\n        except Exception as e:\n            print(f\"[mss截图失败: {e}, 改用PIL.ImageGrab]\")\n            from PIL import ImageGrab\n            img = ImageGrab.grab()\n            return img'''\nif old in content:\n    content = content.replace(old, new)\n    open(r'E:\laya\backend_simple.py', 'w', encoding='utf-8').write(content)\n    print('capture_screen updated with PIL fallback')\nelse:\n    print('pattern not found, need manual fix')\n    # Show current capture_screen\n    import re\n    m = re.search(r'def capture_screen.<em>?return.</em>', content, re.DOTALL)\n    if m:\n        print(m.group()[:500])\n" 2&gt;&amp;1", "workdir": "E:\laya"}}<br />
&lt;/tool_call&gt;<br />
&lt;/function&gt;</p>
]]></description><link>https://lcz.me/topic/1852</link><generator>RSS for Node</generator><lastBuildDate>Fri, 23 Oct 2026 02:19:57 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1852.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Sep 2026 03:44:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 我把codex接入了mimo token plan，但是codex不能完整独立完成任务 on Mon, 21 Sep 2026 04:09:10 GMT]]></title><description><![CDATA[<p dir="auto">是不是 兼容了 决定权在 模型本身。<br />
如果你的修正无效，就不要纠结了。<br />
换模型。用mimo token plan 自己开发的编辑器。二选一吧。<br />
你花费再多的精力搞这个mimo token plan 也不会感谢你。</p>
]]></description><link>https://lcz.me/post/19660</link><guid isPermaLink="true">https://lcz.me/post/19660</guid><dc:creator><![CDATA[williamlouis]]></dc:creator><pubDate>Mon, 21 Sep 2026 04:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to 我把codex接入了mimo token plan，但是codex不能完整独立完成任务 on Mon, 21 Sep 2026 04:05:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/williamlouis" aria-label="Profile: williamlouis">@<bdi>williamlouis</bdi></a> 确实不支持，但是可以用hermes给它改的兼容，（具体怎么改，你看老特视频。）我已经改的兼容，现在就是工具调用这块老有问题。</p>
]]></description><link>https://lcz.me/post/19656</link><guid isPermaLink="true">https://lcz.me/post/19656</guid><dc:creator><![CDATA[huaye XU]]></dc:creator><pubDate>Mon, 21 Sep 2026 04:05:55 GMT</pubDate></item><item><title><![CDATA[Reply to 我把codex接入了mimo token plan，但是codex不能完整独立完成任务 on Mon, 21 Sep 2026 04:03:25 GMT]]></title><description><![CDATA[<p dir="auto">API 都需要有兼容接口才能正常的接入。mimo token plan 用的是open ai 或 Claude 兼用模式接口吗？</p>
]]></description><link>https://lcz.me/post/19655</link><guid isPermaLink="true">https://lcz.me/post/19655</guid><dc:creator><![CDATA[williamlouis]]></dc:creator><pubDate>Mon, 21 Sep 2026 04:03:25 GMT</pubDate></item><item><title><![CDATA[Reply to 我把codex接入了mimo token plan，但是codex不能完整独立完成任务 on Mon, 21 Sep 2026 04:01:29 GMT]]></title><description><![CDATA[<p dir="auto">现象很清楚：模型把工具调用以<strong>文本</strong>吐出来了——<code>&lt;tool_call&gt;</code> / <code>function_calls</code> 原样进了正文，而不是走 OpenAI 的结构化 <code>tool_calls</code> 字段。Codex 只认 <code>choices[].message.tool_calls</code>，看到正文里的文本就当普通回答，再撞上 <code>max_output_tokens</code> 就被截断。不是 Codex 坏了。</p>
<p dir="auto">先做 30 秒判定，直接打你那个 mimo 网关：</p>
<pre><code class="language-bash">curl -s https://&lt;你的网关&gt;/v1/chat/completions \
  -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
  -d '{"model":"&lt;model&gt;","messages":[{"role":"user","content":"列出当前目录"}],
       "tools":[{"type":"function","function":{"name":"exec_command",
         "parameters":{"type":"object","properties":{"cmd":{"type":"string"}},"required":["cmd"]}}}]}'
</code></pre>
<p dir="auto">看返回：</p>
<ul>
<li><code>message.tool_calls</code> 是结构化数组 → 网关支持，问题在 Codex 配置；</li>
<li>正文里出现 <code>&lt;tool_call&gt;</code> → <strong>网关没做 tool 解析，把 <code>tools</code> 参数吞了</strong>。多数「token plan」中转只透传 chat，不支持函数调用，模型只能自己编文本格式。</li>
</ul>
<p dir="auto">对应三条修法：</p>
<ol>
<li><strong>网关侧（最可能）</strong>：换/加支持 function-call 翻译的网关——LiteLLM proxy、new-api 打开「函数调用/工具解析」，或 vLLM 起 <code>--enable-auto-tool-choice --tool-call-parser &lt;对应parser&gt;</code>。纯透传网关无解，换模型也救不了。</li>
<li><strong>Codex 配置侧</strong>：<code>~/.codex/config.toml</code> 的 provider 段加 <code>wire_api = "chat"</code>（第三方 OpenAI 兼容端点基本只有 chat completions、没有 Responses API，协议走错也会退化成文本）；<code>model_context_window</code> / <code>model_max_output_tokens</code> 必须按该模型真实值填，填大填小都会在工具调用中途断。</li>
<li><strong>模型侧</strong>：agentic 工具调用要专门对齐过的模型；mimo 这类偏对话的，就算网关翻译了，多步工具成功率也低。换 Qwen3-Coder / GLM / Kimi K2 / DeepSeek 这类 function-call 训练充分的，或直接用 Codex 官方支持的模型。</li>
</ol>
<p dir="auto">验证闭环：先用上面的 curl 确认拿到结构化 <code>tool_calls</code>，再在 Codex 里跑一个只读单步（让它读一个文件），确认工具真被执行，再放量跑长任务。</p>
<p dir="auto">另：你贴的那串 <code>&amp; "E:\...python.exe" -c ...</code> 是 PowerShell 转义写法，跟截断无关，别往那个方向排查。</p>
]]></description><link>https://lcz.me/post/19654</link><guid isPermaLink="true">https://lcz.me/post/19654</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Mon, 21 Sep 2026 04:01:29 GMT</pubDate></item></channel></rss>