Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
Dev.to AI · 2026/7/31 08:10:07
Your AI Coding Agent Is LYING When It Says "Done
AI 中文解读
AI编程助手说"搞定"的时候,千万别急着信!很多看似完成了任务的智能体,其实只跑了几个测试就宣布胜利,代码库里还藏着没被发现的错误。这篇新闻最抓人的点,就是教你怎么给AI立规矩,让它真正把活干完。
说白了,现在的AI写代码就像个粗心的大厨,炒完菜尝了一口就说"好了",但后厨可能还有没收拾的烂摊子。文章提出一个简单办法:在项目文件里写明规则,要求AI必须运行完整的检查命令,把所有报错修好,并且拿出实际证据才能说"完成"。这就相当于给AI装了个强制验收流程,没通过质检不准交差。
这项做法直接影响的是所有用AI辅助编程的人。以前你费劲检查AI的成果,就像给粗心同事擦屁股;现在有了这套协议,AI会在动手前就明确知道"干完"的标准是什么。这样不仅省去你反复debug的时间,还能防止多个AI协作时错误像滚雪球一样越积越大。对普通上班族来说,以后用AI干活会更省心,交付的东西更靠谱,再也不用担心AI给你挖坑了。
<h2>
TL;DR
</h2>
<p>When an AI agent changes few files, runs few tests, and says "Done", is it really done? Not always. Things may still break in unexpected places.</p>
<p>I prefer to define a strict definition of "Done", which I call the <strong>Task Completion Protocol</strong>. It usually lives in <code>AGENTS.md</code> and, in its simplest form, looks like this:</p>
<ul>
<li>Run the repository's real lint and test commands.</li>
<li>Fix failures and rerun the checks.</li>
<li>Report the exact evidence before claiming completion.</li>
</ul>
<p>This does not replace CI or code review. It moves a basic verification gate earlier, before a broken state reaches the next agent session, the pull request, or you.</p>
<h2>
Video Walkthrough
</h2>
<p>If you prefer a visual walkthrough, this video shows the concept in action. I run the same task twice: without a completion protocol and with it - this demonstrates how explicit definition of "done" helps. I also show few tricks and techniques for making agents follow the protocol.</p>
<p> <iframe src="https://www.youtube.com/embed/UxwJj6wo8J8">
</iframe>
</p>
<h2>
The Agent Says "Done." The Repository Disagrees.
</h2>
<p>You have probably seen some version of this:<br>
</p>
<div class="highlight js-code-highlight">
<pre class="highlight plaintext"><code>Agent:
Done. Implemented the fix and updated the tests.
Terminal:
$ make test
... FAIL
</code></pre>
</div>
<p>The implementation might even look correct. Perhaps the agent ran one focused test, inspected the diff, and produced a tidy summary. Then you run the repository's normal checks and find a lint error, a failing test in a different place, or any other error that was not caught by the agent.</p>
<p>This gets worse as AI-assisted workflows grow to involve multiple agents. In an interactive session, you may spot the failure and fix it yourself. In a multi-step workflow, one worker reports success and the next starts from a broken state. These problems accumulate quickly, and the final state may be badly broken.</p>
<h2>
The Repository Needs to Define What "Done" Means
</h2>
<p>Yes, this is obvious for humans: make some changes, run tests and lint, fix issues, maybe check few other things, and only then say "Done". Agents need it written down, and <code>AGENTS.md</code> is the perfect place for it. I call this section the <strong>Task Completion Protocol</strong>.</p>
<p>Here is a compact version you can adapt to your repository:<br>
</p>
<div class="highlight js-code-highlight">
<pre class="highlight markdown"><code><span class="gu">## Task Completion Protocol</span>
Before reporting completion, classify the task as coding or non-coding.
For coding tasks:
<span class="p">1.</span> Run lint: <span class="sb">`your command to run lint`</span>.
<span class="p">2.</span> Run tests: <span class="sb">`your command to run tests`</span>.
<span class="p">3.</span> Check whether commands, workflows, or architecture changed. If so, update AGENTS.md.
<span class="p">4.</span> Report the commands run, their results, test coverage, and whether AGENTS.md changed.
<span class="p">5.</span> Do not report the task as complete while a required check is failing.
For non-coding tasks:
<span class="p">1.</span> Summarize the findings or actions taken.
<span class="p">2.</span> Confirm that the requested deliverable was produced.
<span class="p">3.</span> Do not run unrelated lint or test commands unless requested.
</code></pre>
</div>
<p>My <a href="https://github.com/gemyago/golang-backend-boilerplate/blob/main/AGENTS.md#task-completion-protocol" rel="noopener noreferrer">Go backend template has a real version of this protocol</a>. It uses <code>make lint</code> and <code>make test</code>. Your protocol should name the exact commands and any specific checks that matter.</p>
<p>Don't just say "Run the tests". This still leaves the agent guessing. It is best to name the exact commands the ag
分享
阅读原文 ↗