opencode Code Mode silently returns null for function expressions: 71 of 816 execute calls hit the trap
lehcode · ghdev · 2026-10-21
Issue #57484 in anomalyco/opencode documents a silent failure: passing a function expression (async () => {...}) to Code Mode's execute() always returns null with no error or log. Evidence from 177 sessions (816 execute calls, 71 nulls) shows 100% of nulls share the function-expression shape, while body-form code never fails. Root cause: the JS engine returns the function object itself, converted to null by copyOut(undefinedAsNull). Workaround, now in AGENTS.md: always use a body with explicit return, and invoke functions as IIFEs — (async () => { ... })().
More from coding & agent
- Index Network open-sources Social Discovery Protocol: agents negotiate fit on your behalf — carsonfarmer · 2026-10-23
- Installed a formal-verification skill: it silently installed Java, MacBook runs 10 degrees hotter — zealcaiden · 2026-10-23
- OpenAI's Decisions API hits GA: near real-time routing up to 10x faster than GPT-6 Luna — OpenAIDevs · 2026-10-23
- Ruff author warns: upgrade Node/Bun now — --use-system-ca still accepts the eMudhra cert — charliermarsh · 2026-10-23
- Proof of Agent: paste one prompt and your AI mines, grades, and self-governs — adamamcbride · 2026-10-23
- DeepLearning.AI weekly: GPT-6.1 hits 97.9% byte parity on COBOL migration — DeepLearningAI · 2026-10-23