<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Agent on 老张开工了</title>
    <link>/agent/</link>
    <description>Recent content in Agent on 老张开工了</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Fri, 19 Jun 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="/agent/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Loop 机制：自循环任务执行</title>
      <link>/posts/2026/06/agent-loop/</link>
      <pubDate>Fri, 19 Jun 2026 00:00:00 +0000</pubDate>
      <guid>/posts/2026/06/agent-loop/</guid>
      <description>上一章的 ReAct 是个心智模型，代码不长。本章把 ReAct 真正做成&amp;quot;长跑循环&amp;quot;——加入预算、反思、终止、错误恢复，让它能扛 30 分钟级别任务而不会&amp;quot;撒手就跑飞&amp;quot;。&#xA;10.1 最小 Loop 的三处不完美 把上一章那 30 行 loop 真正跑长跑，它会失败在哪？&#xA;现象 根因 需要加什么 token 烧到天亮 没有预算 max_tool_calls / max_tokens 模型反复试同一个错 没有&amp;quot;反思&amp;quot; 失败后回看 trace，让模型给假设 任务没完就被模型自己说终了 缺乏 &amp;ldquo;DONE validation&amp;rdquo; 终止前问&amp;quot;DONE&amp;quot;三问 一遇工具 exception 就直接 crash 没有异常通道 tool errors 当 message 喂回 Agent 跟上下文对话头尾都说不止 缺乏沉淀 在循环里维护 state.json 10.2 一个稍微长一点的最小 Agent Loop from dataclasses import dataclass, field @dataclass class AgentState: history: list = field(default_factory=list) tool_calls: int = 0 max_tool_calls: int = 20 failures: list = field(default_factory=list) def step(state: AgentState, user_msg: str) -&amp;gt; tuple[str, AgentState]: if state.</description>
    </item>
    <item>
      <title>Agent 概念：从助手到自治</title>
      <link>/posts/2026/06/agent-concept/</link>
      <pubDate>Wed, 17 Jun 2026 00:00:00 +0000</pubDate>
      <guid>/posts/2026/06/agent-concept/</guid>
      <description>前 8 篇我们都在解决&amp;quot;如何让模型答得好&amp;quot;这个问题。第 9 篇开始换主角：从 &amp;ldquo;答&amp;rdquo; 到 &amp;ldquo;做&amp;quot;。一个能用 bash 改文件、能跑 test、能在 test 跑红时改代码再跑的 AI——这就是 Agent。本章把&amp;quot;Agent 是什么&amp;quot;和&amp;quot;它和 chat 的真实区别&amp;quot;讲透。&#xA;9.1 Chatbot vs Agent：从被动到主动 Chatbot ┌────────────────────────────────┐ （被动回答） │ user msg → model → 回答 → 结束 │ └────────────────────────────────┘ Agent ┌────────────────────────────────┐ （主动执行 + 循环） │ user msg → model → 工具调用 → │ │ 工具输出 → model → 又一个工具调用 → │ │ ... → 最终回答 → 结束 │ └────────────────────────────────┘ 核心区别：能不能在&amp;quot;思考 → 行动 → 观察 → 再思考&amp;quot;的循环里待足够久。Agent 的&amp;quot;待&amp;quot;不是时长，是这个 agent 里有几次转弯、能不能纠错。</description>
    </item>
    <item>
      <title>AI 开发从入门到精通</title>
      <link>/posts/2026/06/ai-course/</link>
      <pubDate>Mon, 01 Jun 2026 00:00:00 +0000</pubDate>
      <guid>/posts/2026/06/ai-course/</guid>
      <description>2026 年是开发者的&amp;quot;AI 元年&amp;quot;。Copilot、Cursor、Claude Code、Codex、OpenCode 这些工具，已经把&amp;quot;写代码&amp;quot;这件事从一项孤军奋战的手工活，变成了一场人机协作的对话游戏。从单文件补全到多 Agent 编排，从 prompt 工程到 MCP 协议，从 vibe coding 到 skill 沉淀——AI 开发不再是一个噱头，它是新一代工程师必须掌握的基础能力。&#xA;本系列从零基础出发，系统拆解 AI 开发的完整知识图谱：&#xA;底层认知：大语言模型如何工作，能力与边界在哪里，上下文窗口与 token 是什么 协作心法：Prompt 工程与上下文工程，Vibe Coding 的理念与节奏 自动化体系：Agent / Loop / Graph / Harness / Subagent 五个关键概念如何串成自治开发流水线 能力扩展：MCP 协议如何让模型连接世界，Skill 如何把一次性经验沉淀为可复用的能力包 实战淬炼：6 个由浅入深的实战案例，从重构遗留项目到搭建多 Agent 工作流，从开发 MCP server 到发布 Skill 库 无论你之前是完全没接触过 AI 工具的程序员，还是已经写了半年 Copilot 想迈向更高阶用法的开发者，都能在这个系列中找到清晰的进阶路线。&#xA;课程大纲 第一篇 · 基础认知篇 AI 开发时代导论：从工具到伙伴 大语言模型原理与实践 Prompt 工程入门：与 LLM 有效沟通 上下文工程：RAG 与长上下文 主流 AI 编程工具全景 Vibe Coding 理念与心法 安全与责任：AI 编程的边界 开发环境搭建：从 IDE 到 Agent CLI 第二篇 · Agent 与自治篇 Agent 概念：从助手到自治 Loop 机制：自循环任务执行 Graph 工作流：多节点编排 Harness 框架：OpenCode 与 superpowers 任务委派：Subagent 与并行执行 Agent 调试与可观测性 第三篇 · MCP 篇 MCP 协议详解 常用 MCP server 实践 MCP server 开发实战 进阶 MCP：传输、资源、提示 MCP 生态与未来 第四篇 · Skill 篇 Skill 概念：能力封装的艺术 Skill 设计原则与最佳实践 编写第一个 Skill Skill 测试与迭代 Skill 库管理与发布 第五篇 · 实战篇 实战一：用 AI 重构遗留项目 实战二：构建知识库 MCP server 实战三：开发团队 Skill 库 实战四：搭建多 Agent 协作系统 实战五：AI 测试与 CI 集成 终章：AI 开发者的成长路径 本系列文章以 2026 年中期的主流工具栈 为基准：Claude Code / Codex / OpenCode / Cursor / GitHub Copilot 等。AI 工具迭代极快，本文中的具体产品界面、命令行参数可能随版本演进——以&amp;quot;原理 + 心法&amp;quot;为主线，把&amp;quot;工具 + 命令&amp;quot;当作示例。</description>
    </item>
  </channel>
</rss>
