StateMirror: Pre-Execution Detection of Hallucinated Tool Calls in Coding Agents
- ID: dfe1a534
- 原文链接: https://arxiv.org/abs/2610.32648
- PDF: https://arxiv.org/pdf/2610.32648
- 作者: Shiwen Shan, Yintong Huo, Zhiying Wu, Yuxin Su
- 日期: 2026-10-23
- 分类: agents
- 来源类型: paper
- 标签: coding-agents, hallucinated-tool-calls, pre-execution-validation, harness
- 质量评分: 4/5
- 抓取时间: 2026-10-27T23:54:36
中文导读
coding agent 会提出在当前环境走不通的动作:访问不存在的路径、调用没装的包,即幻觉式工具调用。4,398 条轨迹预研显示其常见且修复贵:中位数多走 3 个交互步、烧 22.4K token。StateMirror 把检查挪到执行前:在 harness 边界拦截动作,用 AST 和命令分析抽状态谓词,对活代码库做确定性校验。2,508 动作上精确率 0.940、F1 0.817,比最强 LLM judge 高 35.3% F1,检测延迟 17.73 秒→1.50 毫秒、零 token;预执行反馈让 agent 改正 95% 以上幻觉调用,79 任务执行时间降 15.8%。
为什么值得关注
环境边界处的谓词不需要模型来判:确定性校验比 LLM judge 更快更准更便宜,可搬进任何自研 harness。元数据与摘要经 opencli arxiv paper 直取核对,结论数字以论文摘要为准。
关键信息
- 论文标题: StateMirror: Pre-Execution Detection of Hallucinated Tool Calls in Coding Agents
- 作者: Shiwen Shan, Yintong Huo, Zhiying Wu, Yuxin Su
- arXiv: https://arxiv.org/abs/2610.32648
- 发布时间: 2026-10-23
- 关联标签: coding-agents, hallucinated-tool-calls, pre-execution-validation, harness
English Abstract
Large language model (LLM)-based coding agents may propose invalid actions that are not applicable in the execution environment, such as accessing non-existent paths or missing packages. We term this mismatch hallucinated tool use. A preliminary study of 4,398 agent trajectories reveals that these hallucinations are pervasive and costly, requiring a median of 3 additional interaction steps and 22.4K tokens to recover. Existing frameworks rely on reactive, post-execution feedback, wasting runtime resources. Nevertheless, since an agent's execution environment is grounded in concrete codebase and harness components, many action prerequisites can be extracted and validated prior to execution. To this end, we introduce StateMirror, a lightweight pre-execution detector. StateMirror intercepts actions at the harness boundary, extracts state predicates via AST and command analysis, and deterministically validates them against the live repository. By pinpointing exact environment mismatches before execution, StateMirror preempts invalid actions and subsequent recovery cycles. Evaluation on 2,508 actions shows StateMirror achieves 0.940 precision and 0.817 F1 in detecting such hallucinations, surpassing the strongest LLM judge by 35.3% in F1 while reducing median detection latency from 17.73 s to 1.50 ms with zero token consumption. For practical mitigation, StateMirror's pre-execution feedback enables agents to rectify over 95% of hallucinated tool calls. During live mitigation on 79 tasks, StateMirror reduces agent execution time by 15.8% and token consumption by 11.8% while maintaining task resolution.
Obsidian Notes
- 来源笔记: OpenClaw定时任务/论文流水线/2026-10-27-论文流水线.md
- 抓取方式: opencli arxiv paper 2610.32648 -f json(元数据 + 摘要)