<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>MCP on Simon Sun</title><link>https://fatflowers.github.io/zh/tags/mcp/</link><description>Recent content in MCP on Simon Sun</description><generator>Hugo -- 0.155.3</generator><language>zh</language><lastBuildDate>Wed, 29 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://fatflowers.github.io/zh/tags/mcp/index.xml" rel="self" type="application/rss+xml"/><item><title>读 MiroThinker 1.7 Agent源码：长时序 Agent 的护栏机制与上下文管理</title><link>https://fatflowers.github.io/zh/posts/original-tech/miromind-1.7/</link><pubDate>Wed, 29 Apr 2026 00:00:00 +0000</pubDate><guid>https://fatflowers.github.io/zh/posts/original-tech/miromind-1.7/</guid><description>&lt;blockquote&gt;
&lt;p&gt;MiroThinker 1.7 在长问题推理领域取得了&lt;a href="https://github.com/MiroMindAI/MiroThinker"&gt;SOTA的成绩&lt;/a&gt;，优秀的成绩是由强Model与扎实的Harness共同组成的，本文是对其Harness实现中的关键工程优化的记录。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="前置背景"&gt;前置背景&lt;/h2&gt;
&lt;p&gt;MiroThinker 是一个深度研究型 Agent —— 给一个复杂问题（&amp;ldquo;今天 arxiv 上 cs 的论文标题是什么&amp;rdquo;），它会自己拆任务、搜索、抓网页、跑 Python 验证，最后输出 &lt;code&gt;\boxed{答案}&lt;/code&gt;。底子是经典 ReAct：每回合 LLM 思考 + 工具调用，结果回写历史，循环 200~300 次直到收敛。&lt;/p&gt;
&lt;p&gt;256K 上下文 + 单任务最多 300 次工具调用，对工程是不小挑战。运行时整体长这样：&lt;/p&gt;
&lt;div class="mermaid-wrapper"&gt;
&lt;div class="mermaid"&gt;flowchart TD
Task["task_description (用户问题)"] --&gt; Loop
subgraph Loop ["Orchestrator 主循环 (≤200/300 turns)"]
direction TB
For["for turn in 1..max_turns:"]
S1["① LLM 思考 → tool_call"]
S2["② ToolManager → MCP Server&lt;br&gt;(search / python / scrape / ...)"]
S3["③ keep_tool_result：裁剪远端工具结果"]
S4["④ ensure_summary_context：token 预估刹车"]
S5["⑤ rollback / 中间答案池"]
For --&gt; S1 --&gt; S2 --&gt; S3 --&gt; S4 --&gt; S5
end
Loop --&gt; Condition{"结束条件"}
Condition -- "成功 \boxed{}" --&gt; Success["输出最终答案"]
Condition -- "跑满 / 上下文满" --&gt; Failure["generate_failure_summary"]
Failure --&gt; Restart["重启 attempt（≤3 次）"]
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;下文按&amp;quot;护栏机制 → 工具层 → 上下文处理&amp;quot;三块展开。&lt;/p&gt;</description></item></channel></rss>