opencode Code Mode 静默返回 null:函数表达式写法是元凶,816 次调用 71 次失败

lehcode · ghdev · 2026-10-21

anomalyco/opencode 的 issue #57484 报告 Code Mode execute() 的静默失败:当 code 参数传入函数表达式(如 async () => {...})而非函数体时,运行时永远返回 null 且无任何报错或日志。

关键证据:

规避方法:始终用带显式 return 的函数体写法;要执行函数就立即调用 (async () => { ... })()。该做法已写入 AGENTS.md。

原文链接 →

「编程与Agent」频道最新

更多「编程与Agent」频道 AI 资讯 →