Files
sxbh.ltd/dream-series-3.html
Hermes CI FixandHermes AI e1a9b25afa init: sxbh.ltd 官网初始提交
- nginx 安全加固 (CSP, HSTS, 缓存策略)
- 共享 style.css
- 138个页面全部接入

Co-authored-by: Hermes AI <agent@hermes>
2026-07-11 17:29:24 +08:00

97 lines
5.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>系列三:一个Bug的修复全程 — web_search从缺失到就绪 | 博海技术</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;background:#f5f6f7;color:#2c3e50;line-height:1.9}
.container{max-width:780px;margin:0 auto;padding:0 20px}
.header{background:linear-gradient(135deg,#0f172a,#1e293b);padding:36px 0;text-align:center}
.header h1{font-size:24px;font-weight:700;color:#fff;line-height:1.4}
.header .meta{color:#94a3b8;font-size:13px;margin-top:10px}
.header .meta span{margin:0 8px}
.content{background:#fff;padding:30px 0}
.content h2{font-size:20px;font-weight:700;margin:28px 0 12px;padding-bottom:6px;border-bottom:2px solid #e2e8f0}
.content p{font-size:15px;margin-bottom:12px;color:#334155}
.content ul{padding-left:20px;margin-bottom:12px;font-size:15px;color:#334155}
.content li{margin-bottom:4px}
.code{background:#1e2a35;border-radius:6px;padding:12px 16px;margin:10px 0;overflow-x:auto;font-family:monospace;font-size:13px;line-height:1.5;color:#e2e8f0}
.code .cm{color:#6b7280;font-style:italic}
table{width:100%;border-collapse:collapse;margin:12px 0;font-size:14px}
td,th{padding:8px 12px;text-align:left;border-bottom:1px solid #e2e8f0}
th{background:#0f172a;color:#fff;font-weight:600}
tr:nth-child(even){background:#f8fafc}
.quote{background:#fffbeb;border-left:3px solid #fbbf24;padding:10px 16px;margin:12px 0;border-radius:0 6px 6px 0;font-size:14px;color:#92400e}
.quote-ok{background:#f0fdf4;border-left:3px solid #34d399;padding:10px 16px;margin:12px 0;border-radius:0 6px 6px 0;font-size:14px}
.footer{background:#0f172a;color:#94a3b8;text-align:center;padding:20px 0;font-size:12px}
.tag{display:inline-block;background:rgba(251,191,36,.12);color:#fbbf24;padding:3px 12px;border-radius:12px;font-size:12px;margin-top:8px}
</style>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<div class="header">
<div class="container">
<h1>系列三:一个Bug的修复全程<br>web_search 从"不存在"到20条结果</h1>
<div class="meta"><span>📅 2026-06-26</span><span>🏷️ 运维 · 工程排错</span><span>⏱ 5分钟</span></div>
<span class="tag">🔧 真实案例</span>
</div>
</div>
<div class="content">
<div class="container">
<h2>一、问题:Agent反复调用不存在的工具</h2>
<p>梦境第一份报告揭示了一个优先级最高的错误模式:Agent 在几乎所有 Session 开头都会调用 <code>web_search</code><code>web_extract</code>,然后收到"Tool does not exist"错误,再切换到浏览器方案。每次浪费2轮交互。</p>
<p>检查配置发现根因:</p>
<div class="code"><span class="cm"># ~/.hermes/config.yaml</span><br>
web:<br>
&nbsp;&nbsp;search_backend: <span class="cm">'' # ← 空的!</span><br>
&nbsp;&nbsp;extract_backend: <span class="cm">'' # ← 空的!</span></div>
<div class="quote"><strong>⚠️ 经验:</strong> 工具"不存在"不等于工具"不可用"。空的配置字段意味着"没配置",不是"不支持"。这是梦境报告推动的第一个认知修正。</div>
<h2>二、修复链:整整7步</h2>
<p>本以为填个配置就行,结果挖出了一整条修复链:</p>
<table>
<tr><th>#</th><th>步骤</th><th>发现的问题</th></tr>
<tr><td>1</td><td>确认 SearXNG 已运行</td><td>Docker 实例在,但 JSON API 被禁用</td></tr>
<tr><td>2</td><td>启用 JSON 输出</td><td>settings.yml 默认只有 html 格式</td></tr>
<tr><td>3</td><td>重启容器</td><td>iptables 规则损坏,端口映射丢失</td></tr>
<tr><td>4</td><td>换用 host 网络模式</td><td>绕过 Docker 网络问题,直接暴露端口</td></tr>
<tr><td>5</td><td>修 DNS</td><td>容器内 127.0.0.53 无法解析外部域名</td></tr>
<tr><td>6</td><td>换搜索引擎</td><td>Google/DuckDuckGo 被墙,启用百度/搜狗</td></tr>
<tr><td>7</td><td>调大超时</td><td>3秒对中国网络太短,改成10秒</td></tr>
</table>
<h2>三、验证结果</h2>
<div class="quote-ok">✅ 搜索"Hermes Agent 梦境模式" → 返回20条结果(百度+搜狗)<br>
✅ 搜索"AI 自进化 Agent" → 相关中文博客和教程<br>
✅ 跨 Profile 继承 — 改一次配置,8个Profile全部生效</div>
<h2>四、这条修复链揭示了什么?</h2>
<p>一个看似简单的"填个配置"动作,实际上踩了5个坑:</p>
<ul>
<li><strong>假设偏差</strong> — "容器在运行就能用"是错的,它可能没有启用你需要的能力</li>
<li><strong>网络复杂</strong> — Docker 的 iptables、DNS、端口映射三个独立问题同时出现</li>
<li><strong>环境特殊性</strong> — 国际搜索引擎在国外好用,在国内需要替换源</li>
<li><strong>超时敏感</strong> — 默认3秒超时对中国网络环境不够,改到10秒才稳定</li>
<li><strong>配置层级</strong> — 改全局配置不够,Profile 层可能有自己的覆盖</li>
</ul>
<h2>五、梦境闭环</h2>
<p>最有意思的是:明天的梦境报告会自动检查 <code>web_search</code> 问题是否真的被修复了。如果报告显示"不再出现",它会标记为 <strong>fixed</strong>。整个从"发现问题→诊断→修复→验证→确认"的闭环就完整了。</p>
<p>这就是梦境模式的意义——不是取代人去修 Bug,而是让每个 Bug 的修复过程都有据可查、可追踪、可验证。</p>
</div>
</div>
<div class="footer">博海技术管理 · 2026-06-26</div>
</body>
</html>