<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Deepseek on OHTLY Blog</title>
    <link>https://blog.ohtly.com/tags/deepseek/</link>
    <description>Recent content in Deepseek on OHTLY Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Tue, 14 Jul 2026 14:30:09 +0800</lastBuildDate>
    <atom:link href="https://blog.ohtly.com/tags/deepseek/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>为 Pi Coding Agent 编写自定义工具</title>
      <link>https://blog.ohtly.com/posts/2026-07-14-pi-coding-agent-custom-tool/</link>
      <pubDate>Tue, 14 Jul 2026 10:30:00 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-07-14-pi-coding-agent-custom-tool/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;&#xA;  背景&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%83%8c%e6%99%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Pi Coding Agent 的扩展机制允许向 AgentSession 注册自定义 Tool，LLM 在对话中可以直接调用这些工具。扩展是 ESM 模块，通过 &lt;code&gt;pi.registerTool()&lt;/code&gt; 注册，自动加载到当前 Session。&lt;/p&gt;&#xA;&lt;h2 id=&#34;注册-tool&#34;&gt;&#xA;  注册 Tool&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%b3%a8%e5%86%8c-tool&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Extension 文件导出一个默认函数，接收 &lt;code&gt;pi: ExtensionAPI&lt;/code&gt; 作为参数：&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;ExtensionAPI&lt;/span&gt; } &lt;span style=&#34;color:#66d9ef&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;@earendil-works/pi-coding-agent&amp;#34;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;Type&lt;/span&gt; } &lt;span style=&#34;color:#66d9ef&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;typebox&amp;#34;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;export&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;default&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; (&lt;span style=&#34;color:#a6e22e&#34;&gt;pi&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;ExtensionAPI&lt;/span&gt;) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;pi&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;registerTool&lt;/span&gt;({ &lt;span style=&#34;color:#75715e&#34;&gt;/* ... */&lt;/span&gt; });&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;pi.registerTool()&lt;/code&gt; 接收一个对象，关键字段如下：&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;字段&lt;/th&gt;&#xA;          &lt;th&gt;类型&lt;/th&gt;&#xA;          &lt;th&gt;说明&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;name&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;工具唯一标识，LLM 据此调用&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;label&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;显示名称，UI 中展示&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;description&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;工具描述，LLM 据此判断何时调用&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;promptSnippet&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;简短提示，注入系统提示词&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;promptGuidelines&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;string[]&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;调用 guideline，LLM 参考&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;parameters&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;TypeBox Schema&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;参数 Schema，LLM 据此生成参数&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;code&gt;execute&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;function&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;工具执行函数&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h3 id=&#34;typebox-schema&#34;&gt;&#xA;  TypeBox Schema&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#typebox-schema&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;parameters&lt;/code&gt; 用 TypeBox 定义：&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pi Web 配置 DeepSeek 与自定义工具</title>
      <link>https://blog.ohtly.com/posts/2026-07-13-pi-web-deepseek-custom-tools/</link>
      <pubDate>Mon, 13 Jul 2026 09:44:05 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-07-13-pi-web-deepseek-custom-tools/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;&#xA;  背景&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%83%8c%e6%99%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/earendil-works/pi&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Pi Coding Agent&lt;/a&gt; 是一个开源的 AI 编程助手，69K+ Stars，MIT 协议。它的架构分三层：&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;https://www.npmjs.com/package/@earendil-works/pi-ai&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;@earendil-works/pi-ai&lt;/a&gt;&lt;/strong&gt; — 统一多 Provider LLM API&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;https://www.npmjs.com/package/@earendil-works/pi-agent-core&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;@earendil-works/pi-agent-core&lt;/a&gt;&lt;/strong&gt; — Agent 运行时（Tool calling、状态管理）&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;https://www.npmjs.com/package/@earendil-works/pi-coding-agent&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;@earendil-works/pi-coding-agent&lt;/a&gt;&lt;/strong&gt; — CLI + SDK&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/agegr/pi-web&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Pi Web&lt;/a&gt; 是社区开发的 Web UI，1.1K Stars。它通过 Pi SDK 直接创建 AgentSession，通过 SSE 推送流式事件到浏览器，不跑 CLI 子进程。&lt;/p&gt;&#xA;&lt;p&gt;同类项目还有 &lt;a href=&#34;https://github.com/jmfederico/pi-web&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;jmfederico/pi-web&lt;/a&gt;（支持远程 Machine/Fleet）和 &lt;a href=&#34;https://github.com/minghinmatthewlam/pi-gui&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;pi-gui&lt;/a&gt;（Electron 桌面版）。&lt;/p&gt;&#xA;&lt;h2 id=&#34;部署&#34;&gt;&#xA;  部署&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%83%a8%e7%bd%b2&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;环境要求：Node.js 22+。&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/agegr/pi-web.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd pi-web&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;npm install&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;npm run dev&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;默认运行在 &lt;code&gt;http://localhost:30141&lt;/code&gt;。&lt;/p&gt;&#xA;&lt;h2 id=&#34;配置-deepseek-模型&#34;&gt;&#xA;  配置 DeepSeek 模型&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%85%8d%e7%bd%ae-deepseek-%e6%a8%a1%e5%9e%8b&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Pi Coding Agent 内置了 DeepSeek Provider，模型定义在 &lt;a href=&#34;https://github.com/earendil-works/pi/blob/main/packages/ai/src/providers/deepseek.models.ts&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;deepseek.models.ts&lt;/a&gt;，包含 &lt;code&gt;deepseek-v4-flash&lt;/code&gt; 和 &lt;code&gt;deepseek-v4-pro&lt;/code&gt;。&lt;/p&gt;</description>
    </item>
    <item>
      <title>四种 PageIndex 检索方案的 Token 消耗对比</title>
      <link>https://blog.ohtly.com/posts/2026-07-09-pageindex-token-comparison/</link>
      <pubDate>Thu, 09 Jul 2026 15:21:34 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-07-09-pageindex-token-comparison/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;&#xA;  背景&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%83%8c%e6%99%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;PageIndex 是一个无向量（vectorless）、基于推理（reasoning-based）的 RAG 框架。核心思路是将文档解析为树状索引，让 LLM 通过推理来导航定位内容，而不是靠向量相似度搜索。&lt;/p&gt;&#xA;&lt;p&gt;这次实验的数据源是一本人教版《物理必修第二册》扫描版 PDF。因为纯扫描件没有文字层，先用 MinerU（vlm-engine）OCR 提取了结构化文本，再插入 &lt;code&gt;&amp;lt;!-- page N --&amp;gt;&lt;/code&gt; 标记以使页码可追溯。最后用 PageIndex 对这份带页码的 markdown 建立树索引。&lt;/p&gt;&#xA;&lt;p&gt;基于同一份数据，实现了四种检索方案，对比它们的实现差异和 Token 消耗。&lt;/p&gt;&#xA;&lt;h2 id=&#34;四种方案的设计差异&#34;&gt;&#xA;  四种方案的设计差异&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e5%9b%9b%e7%a7%8d%e6%96%b9%e6%a1%88%e7%9a%84%e8%ae%be%e8%ae%a1%e5%b7%ae%e5%bc%82&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;方案-a简单查询&#34;&gt;&#xA;  方案 A：简单查询&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88-a%e7%ae%80%e5%8d%95%e6%9f%a5%e8%af%a2&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;两步走，两次独立 LLM 调用：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LLM #1 看树结构 → 返回行号范围&#xA;LLM #2 取内容 → 回答&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;没有验证步骤，LLM 一次定生死。&lt;/p&gt;&#xA;&lt;h3 id=&#34;方案-b手写-agent-循环&#34;&gt;&#xA;  方案 B：手写 Agent 循环&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88-b%e6%89%8b%e5%86%99-agent-%e5%be%aa%e7%8e%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;三步走，三次独立 LLM 调用：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LLM #1 identify_ranges → 返回候选行号列表&#xA;LLM #2 evaluate → 判断内容是否包含答案&#xA;LLM #3 final_answer → 基于内容给出最终回答&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;写了 for 循环遍历候选清单，显式 evaluate 确认命中后才回答。&lt;/p&gt;</description>
    </item>
    <item>
      <title>DeepSeek V4 DSML 标记导致 Codex 任务中止</title>
      <link>https://blog.ohtly.com/posts/2026-06-26-deepseek-v4-dsml-codex-abort/</link>
      <pubDate>Fri, 26 Jun 2026 11:24:38 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-06-26-deepseek-v4-dsml-codex-abort/</guid>
      <description>&lt;h2 id=&#34;问题现象&#34;&gt;&#xA;  问题现象&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%97%ae%e9%a2%98%e7%8e%b0%e8%b1%a1&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Codex 通过 Moon Bridge 使用 DeepSeek V4 Flash 时，任务执行中途突然终止。终端输出类似：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;｜｜DSML｜｜tool_calls&amp;gt; &amp;lt;｜｜DSML｜｜invoke name=&amp;#34;exec_command&amp;#34;&amp;gt; &amp;lt;｜｜DSML｜｜parameter name=&amp;#34;cmd&amp;#34; string=&amp;#34;true&amp;#34;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;然后任务就卡住不动了。&lt;/p&gt;&#xA;&lt;h2 id=&#34;问题分析&#34;&gt;&#xA;  问题分析&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%97%ae%e9%a2%98%e5%88%86%e6%9e%90&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;moon-bridge-架构&#34;&gt;&#xA;  Moon Bridge 架构&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#moon-bridge-%e6%9e%b6%e6%9e%84&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Moon Bridge 是一个 Go 编写的协议转换与模型路由代理，对外暴露 OpenAI Responses API（&lt;code&gt;/v1/responses&lt;/code&gt;），对内支持 Anthropic Messages、Google Gemini、OpenAI Chat Completions 等多种上游协议。&lt;/p&gt;&#xA;&lt;p&gt;当 Codex 发起请求时，Moon Bridge 负责把 OpenAI Responses 格式的请求转换为上游 Provider 需要的格式。&lt;/p&gt;&#xA;&lt;h3 id=&#34;根因deepseek-v4-dsml&#34;&gt;&#xA;  根因：DeepSeek V4 DSML&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%a0%b9%e5%9b%a0deepseek-v4-dsml&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;DeepSeek V4 在工具调用场景下，会将 DSML（DeepSeek Markup Language）标记直接输出到 &lt;code&gt;content&lt;/code&gt; 字段，而不是作为结构化的 &lt;code&gt;tool_calls&lt;/code&gt; 返回。这违反了 OpenAI API 契约——工具调用应该只在 &lt;code&gt;tool_calls&lt;/code&gt; 字段中传递。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Codex CLI 用 DeepSeek 的协议转换方案</title>
      <link>https://blog.ohtly.com/posts/2026-06-24-codex-cli-deepseek/</link>
      <pubDate>Wed, 24 Jun 2026 14:35:40 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-06-24-codex-cli-deepseek/</guid>
      <description>&lt;p&gt;Codex CLI 是 OpenAI 出品的终端编码 agent。2026 年 2 月起，Codex 只支持 OpenAI Responses API（&lt;code&gt;/v1/responses&lt;/code&gt;），不再兼容 Chat Completions（&lt;code&gt;/v1/chat/completions&lt;/code&gt;）。DeepSeek 官方 API 只提供 Chat Completions 接口，两者协议不互通。&lt;/p&gt;&#xA;&lt;p&gt;需要一个协议转换层。&lt;/p&gt;&#xA;&lt;h2 id=&#34;方案对比&#34;&gt;&#xA;  方案对比&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88%e5%af%b9%e6%af%94&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;方案&lt;/th&gt;&#xA;          &lt;th&gt;原理&lt;/th&gt;&#xA;          &lt;th&gt;评价&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Chutes&lt;/td&gt;&#xA;          &lt;td&gt;云端 Responses→Chat 翻译&lt;/td&gt;&#xA;          &lt;td&gt;依赖第三方云服务&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;LiteLLM&lt;/td&gt;&#xA;          &lt;td&gt;全能 AI 网关&lt;/td&gt;&#xA;          &lt;td&gt;功能太多，对 Codex 场景大材小用&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;open-codex fork&lt;/td&gt;&#xA;          &lt;td&gt;用 Chat API 重写&lt;/td&gt;&#xA;          &lt;td&gt;已停更&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;strong&gt;Moon Bridge&lt;/strong&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;strong&gt;本地 Go 代理，协议转换 + 路由&lt;/strong&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;strong&gt;DeepSeek 官方推荐，轻量专注&lt;/strong&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Moon Bridge 是 Go 写的协议转换代理，对外暴露 &lt;code&gt;POST /v1/responses&lt;/code&gt;，对内将请求转为 Anthropic Messages API 格式发给 DeepSeek（DeepSeek 兼容 Anthropic 协议）。支持多 Provider 路由、请求跟踪、Web Console 管理。&lt;/p&gt;</description>
    </item>
    <item>
      <title>排查 OpenClaw memory_search 工具被禁用的问题</title>
      <link>https://blog.ohtly.com/posts/2026-06-15-openclaw-memory-search/</link>
      <pubDate>Mon, 15 Jun 2026 18:32:05 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-06-15-openclaw-memory-search/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;&#xA;  背景&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%83%8c%e6%99%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;OpenClaw 部署在 &lt;code&gt;server-a&lt;/code&gt; 上的实例（版本 &lt;strong&gt;2026.6.5&lt;/strong&gt;），用户反馈 &amp;ldquo;Memory search 暂时不可用&amp;rdquo;。另一个实例 &lt;code&gt;server-b&lt;/code&gt; 上相同配置却工作正常。&lt;/p&gt;&#xA;&lt;p&gt;排查目标：找到差异，修复问题。&lt;/p&gt;&#xA;&lt;h2 id=&#34;排查过程&#34;&gt;&#xA;  排查过程&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%8e%92%e6%9f%a5%e8%bf%87%e7%a8%8b&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;阶段-1对比配置差异&#34;&gt;&#xA;  阶段 1：对比配置差异&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%98%b6%e6%ae%b5-1%e5%af%b9%e6%af%94%e9%85%8d%e7%bd%ae%e5%b7%ae%e5%bc%82&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;先对比两边的 &lt;code&gt;memorySearch&lt;/code&gt; 配置：&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;实例&lt;/th&gt;&#xA;          &lt;th&gt;provider&lt;/th&gt;&#xA;          &lt;th&gt;状态&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;server-b（正常）&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;ollama-ollama-host&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;✅&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;server-a（异常）&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;ollama&lt;/code&gt; + &lt;code&gt;remote.baseUrl&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;❌&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;配置都指向同一台 Ollama 服务器，模型都是 &lt;code&gt;bge-m3&lt;/code&gt;。尝试了三种修改：&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;将 provider 改为 &lt;code&gt;ollama-ollama-host&lt;/code&gt; → 插件不加载（该实例无本地 Ollama）&lt;/li&gt;&#xA;&lt;li&gt;将 provider 改为 &lt;code&gt;openai-compatible&lt;/code&gt; → 插件同样不加载&lt;/li&gt;&#xA;&lt;li&gt;恢复原配置 → 插件正常加载&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;结论：&lt;strong&gt;provider 名不是根本原因&lt;/strong&gt;，ollama 插件本身加载正常。&lt;/p&gt;&#xA;&lt;h3 id=&#34;阶段-2分析日志&#34;&gt;&#xA;  阶段 2：分析日志&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%98%b6%e6%ae%b5-2%e5%88%86%e6%9e%90%e6%97%a5%e5%bf%97&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;日志中发现了关键线索：&lt;/p&gt;</description>
    </item>
    <item>
      <title>openclaw 6.6 修复 DeepSeek 定时 Wiki 编译问题</title>
      <link>https://blog.ohtly.com/posts/2026-06-14-openclaw-66-deepseek-wiki-cron/</link>
      <pubDate>Sun, 14 Jun 2026 13:29:16 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-06-14-openclaw-66-deepseek-wiki-cron/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;&#xA;  背景&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%83%8c%e6%99%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;我在一台个人服务器上运行 OpenClaw，并使用 Memory Wiki 功能把本地知识库编译成可检索的结构化内容。这个编译动作原本由一个每天定时执行的 cron job 完成，任务内容很简单：触发 &lt;code&gt;/wiki-compile&lt;/code&gt;。&lt;/p&gt;&#xA;&lt;p&gt;这类任务长期运行正常。后来默认模型切换到 DeepSeek 后，定时任务开始失败，表面错误是：&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;LLM request failed.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;一开始这个错误很容易被误判成 DeepSeek 接口不稳定。但后续排查发现，问题并不是 DeepSeek 全局不可用，也不是 Wiki 编译工具本身坏了，而是 OpenClaw 旧版本中 cron isolated agent 运行路径的 timeout 传递问题。&lt;/p&gt;</description>
    </item>
    <item>
      <title>OpenCode 换用 DeepSeek V4 后的代理与搜索配置</title>
      <link>https://blog.ohtly.com/posts/2026-06-09-opencode-deepseek-v4-proxy-websearch/</link>
      <pubDate>Tue, 09 Jun 2026 21:14:32 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-06-09-opencode-deepseek-v4-proxy-websearch/</guid>
      <description>&lt;p&gt;最近把 OpenCode 的主力模型从 MiniMax 换成了 DeepSeek V4，顺便整理了下 webfetch 代理和 websearch 工具的配置。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
