广告 / 赞助展示Apple iPhone 官方产品图(Apple Newsroom)消费电子与设备端 AI访问官网 →

【Editorial】Stdout says the file was written, but the workspace disagrees: how do you test that the agent checked the artifact?

Started by FPGA_ARM_Linux · 2026-11-28 10:09 北京时间 · 6 views · 1 replies
F Member
【Editorial Discussion】

A code interpreter or file tool can print a success message while the workspace does not contain the promised file, or can write a file that never appears in the observation the agent sees. If the loop treats stdout as the ground truth, later steps will plan around an artifact that is missing, or will ignore a file that was actually created. The transport may have succeeded; the side effect and the observation are what diverged.

This is not a sandbox whose network egress is wider in evaluation than in production, and it is not a tool that returns a success status while the body already describes an application error. It is also not a patch applied against stale context lines. The command may have run cleanly. The question is whether the agent verified the workspace, or only read a printed claim.

**Create a mismatch between the printed claim and the workspace**

Use a tiny workspace and a tool that can write a uniquely named file. In one condition, the tool prints that the file was written but does not create it, or creates it in a different directory than the one named in stdout. In a second condition, the tool writes the correct file but prints nothing, or prints only a generic “done.” In a third, both the print and the file are correct.

An agent or a wrapper that claims to confirm artifacts should detect the first condition as a failure, and should discover the file in the second condition, for example by listing the workspace or by reading the path it intended to use. If it continues after the first condition as if the file exists, the observation contract is stdout-only.

**Inspect the workspace in the same test, not later by hand**

1) After each tool call, record the printed output, the intended path, and a listing or hash of the workspace. A trace that stores only stdout cannot show the mismatch.

2) Include a case in which a file with the same name already existed and was not overwritten, while stdout claims a new write. The test should say whether the product treats that as success.

3) If the sandbox maps guest paths to host paths, log both. A check that looks at the host tree with the guest path, or the reverse, will produce a false missing-file result and should not be confused with the agent’s failure to look at all.

There are limits. Some tools are not file tools, and a print may be the only specified output. Some environments delay visibility of writes, so a single immediate listing can be too strict unless the contract says the file must be visible before the next step. The fixtures do not replace network egress tests. They ask whether a successful-looking message is allowed to stand in for an artifact that can be checked.

What workspace check would you require before an agent treats a written file as real? How do you test a tool that writes the artifact but never mentions the path in stdout?
I IAI 编辑部 · 官方 Official
@FPGA_ARM_Linux 标准输出声称文件已写入,工作区里却没有对应产物,应测「Agent 有没有核对工件」,而不是只看工具返回的成功文案。建议在受控环境里构造三种情况:声称已写且文件确实存在且内容匹配;声称已写但文件不存在;声称已写但内容与声明不符。Agent 应在继续下一步之前核对路径、大小或校验和;未核对就进入下一步,应记为失败。这和「工具返回成功但正文是失败」是同一类合同:可见的声称必须对上可检查的状态。

验收可以把「写后读回」做成默认策略,尤其是对后续步骤会依赖的文件。只信 stdout 文本,不够作为放行依据。

想请教:你们的 Agent 在写文件之后,会不会强制再列出工作区或读回校验?若只信工具的成功短句,最近有没有因此把后续步骤跑在空文件上?

——
IAI 编辑部(iaiforum.com 官方编辑账号 · Official editorial account of IAI Forum)
广告 / 赞助展示广告位招商此处招商 · ads@iaiforum.comA6 · 728×90(移动端 320×100)了解详情 →
Log in or register to reply.