正在打开每日关注
正在打开每日关注
从 Agent Loop 出发,拆解上下文、权限、沙箱、持久化与评测如何构成生产级编码智能体。
Over the past few months, I've been dissecting how modern coding agents work. Specifically: Claude Code OpenCode Pi Aider And I documented everything I learned in a new open-source series… It’s called “Building a Coding Agent From Scratch.” Most people focus on the agent loop. But that's only one piece of the system. What makes coding agents work is everything around it: Context engineering Human-in-the-loop workflows Durable execution Permissions & sandboxes Skills & subagents AI evals & observability The LLM is only one small component. And the harness around it is what makes coding agents useful. Over the next eight lessons, we'll build a production-grade coding agent from scratch in Python using: @modal to host open-source LLMs such as Qwen3 and run remote sandboxes Kitaru (by @zenml_io) for the durable runtime, so agents can pause, resume, and recover from failures Opik (by @Cometml) to evaluate, observe, and compare agent runs in production Pydantic AI for the bare-bones agent loop, showing just how little code makes up the "agent" (and showing how much engineering lives in the coding harness built around it) And here's what you will learn inside the series: 1. System architecture 2. Agent loops & human approval 3. Durable execution & replay 4. Context engineering 5. Permissions & sandboxes 6. Skills & parallel subagents 7. AI evals & observability 8. Deployment The first article will go live tomorrow in Decoding AI Magazine. If you've ever wanted to understand how coding agents work under the hood, this series is for you. Subscribe to get the first lesson in your inbox: https://t.co/jXzj84tvoS
是什么 文章把编码智能体拆成“接口—Harness—Agent Loop—基础模块—评测”五层,核心主张是:同一模型的效果差异,往往来自模型外围的工程系统。它以 Decode 为教学载体,从 Pydantic AI 的最小循环扩展到支持 TUI 交互、远程无头运行和并行 Agent 的完整 Harness。
核心设计 请求先经 steering queue 与 priority gate 进入 context window;LLM 产出工具动作,权限层校验后交给 sandbox 执行,观察结果再回流,形成 Action/Observation 闭环。上下文被视为有限预算,通过 summary、tail、截断或清空缓解 context decay;LSP 提供低成本即时反馈。Kitaru 负责暂停、恢复、重放与故障恢复,Modal 等 Provider 承担模型和远程沙箱,Opik 记录模型调用与工具调用并支撑回归评测。
关键洞察 价值不在于再写一个 ReAct 循环,而在于把人机协同、权限、安全隔离、记忆、技能、子 Agent、耐久运行和可观测性组合成可控系统。交互模式适合单会话调试,远程模式适合积压任务、PR 审查等自动化。
边界与风险 文章是架构教程而非完整生产验证;Terminal-Bench 的排名案例属于文中引用。并行 Agent 会放大成本、权限和状态协调问题,压缩上下文也可能丢失关键证据;沙箱、重放、评测指标和模型供应商切换仍需结合具体业务做安全与可靠性验证。