构建可迭代的编程代理运行框架,让模型输出真正落地为环境动作。
From Prompt to Harness: Coderlet from Scratch
- 以请求生命周期为核心,划分模型、执行与状态三重边界
- 实现从模型生成到环境动作的闭环转换,支持运行时反馈回传
- 支持通过持续自举逐步优化运行框架,适合开发智能编程工具
单一模型无法决定编程代理的行为。模型所见、动作如何进入环境、反馈如何返回、一次运行如何影响下一次,均取决于运行框架的设计。简化的示例通常仅展示模型与工具的基本交互,而生产系统则将这些关系分散在复杂的组件与依赖中。本文通过跟踪单个请求的完整流程——上下文构建、模型决策、环境动作、观测返回与状态延续——研究一种紧凑的运行框架设计。三个边界(模型、执行、状态)连接模型服务、工具环境与持久状态,请求生命周期决定这些转换的顺序。三者共同揭示了运行框架的核心作用:将模型生成转化为环境动作,将运行时反馈带入后续决策,并支持状态跨请求延续。在此运行结构之上,运行框架还可通过持续自举逐步优化。该设计已实现在可执行项目 https://github.com/lilinxi/Coderlet。
原文摘要 · Abstract (English)
A model alone does not determine how a programming agent acts. What the model sees, how actions enter the environment, how feedback returns, and how one run affects the next all depend on how the harness is organized. Minimal examples usually show only the basic interaction between a model and tools, while production systems spread these relationships across complex components and dependencies. This paper studies a compact harness design by following a single request through context formation, model decision, environmental action, observation return, and state continuation. Three boundaries---model, execution, and state---connect the model service, tool environment, and persistent state, while the request lifecycle determines the order in which these transitions occur. Together, they show the harness's core role: turning model generations into environmental actions, carrying runtime feedback into later decisions, and allowing state to continue across requests. On top of this runtime structure, a harness can also be gradually refined across runs through continued bootstrapping. The design is realized in the executable artifact https://github.com/lilinxi/Coderlet.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。