给AI编程助手换“手脚”,比换“大脑”更省钱
给AI编程助手换“手脚”,比换“大脑”更省钱。研究者把AI编程助手的“外壳”拆成三块——规划、动作空间、上下文管理,固定执行流程,在4个模型上跑了176组对照。结果反直觉:上下文管理在窗口紧张时价值最大,主要靠防止“溢出崩溃”;而让被删掉的内容可恢复,模型几乎不用,纯属白加。规划对弱模型是“拐杖”,对强模型则变成“省钱器”——准确率几乎不变,成本却降了。更狠的是:会写bash的模型,只给一个终端接口就够了,比给它一堆预设工具更便宜、效果不差。换句话说,给AI换“手脚”比换“大脑”更划算。这不是你明天能上手的技巧,但它告诉你:别急着追新模型,先把工具链调对。
📄 原文摘要(英文)
Coding harnesses shape how autonomous coding agents translate model capabilities into long-horizon software-engineering performance, yet existing work typically evaluates harnesses as monolithic systems, leaving the effectiveness of individual components unclear. To enable component-level comparisons, we study this question with a lightweight coding harness whose execution loop is fixed while three components are varied: planning, action space, and context management. Across four models evaluated on SWE-Bench Verified and Terminal-Bench 2.1, we evaluate 176 matched settings spanning five context-management strategies, four context-window budgets, and targeted ablations of planning and action space. We find that: (1) Context management becomes increasingly valuable as the context-window budget tightens, with most of its benefit coming from preventing context-overflow failures. (2) Staging rule-based elision before LLM-based summarization provides the strongest overall efficiency among the context-management strategies, whereas making elided content recoverable adds machinery that models rarely use and yields no accuracy gain. (3) Planning shifts from an accuracy scaffold for weaker models to a cost saver for stronger models, with little change in accuracy. (4) Predefined tools improve performance for models with weaker bash proficiency, whereas bash-capable models can operate effectively with a bash-only interface and achieve substantially lower cost, especially on command-line-centric tasks. Trajectory-level analysis explains these effects: context management extends execution trajectories without substantially altering agent behavior, planning changes where trajectories stop, and the action space changes the granularity at which code is written. These findings inform model- and budget-aware harness design and provide a modular framework for evaluating future harness components.