anomalyco / anomalyco/opencode
v1.18.30: every prompt fails with TypeError (undefined layer node in Effect layer assembly during SystemPrompt.environment) — works on v1.18.20
Open
@neriousy is already working on this.
Since Sep 13, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Since upgrading to v1.18.30, every prompt fails with a TypeError during system-prompt assembly. The same config works perfectly on v1.18.20 (verified by A/B testing both binaries with an identical ~/.config/opencode/opencode.jsonc).
Error
TypeError: undefined is not an object (evaluating 'a.name')
at resolve (/$bunfs/root/chunk-36bwgd4p.js:2:1659)
at a (/$bunfs/root/chunk-36bwgd4p.js:2:936)
at map (native:1:11)
at <anonymous> (/$bunfs/root/chunk-36bwgd4p.js:2:1626)
at a (/$bunfs/root/chunk-36bwgd4p.js:2:1166)
at map (native:1:11)
at <anonymous> (/$bunfs/root/chunk-36bwgd4p.js:2:1626)
at a (/$bunfs/root/chunk-36bwgd4p.js:2:1166)
at map (native:1:11)
at <anonymous> (/$bunfs/root/chunk-36bwgd4p.js:2:1390)
at SystemPrompt.environment (/$bunfs/root/chunk-n59f7cwr.js:50:13096)
at SystemPrompt.environment (definition) (/$bunfs/root/chunk-n59f7cwr.js:4:14254)
at SessionPrompt.run (/$bunfs/root/chunk-n59f7cwr.js:50:14576)
...
CLI output:
Error: {
"name": "UnknownError",
"data": { "message": "Unexpected server error. Check server logs for details.", "ref": "err_..." }
}
Analysis
- The crashing frame is Effect-TS layer-graph assembly. The bundled code contains
resolve:(a)=>s.get(a.name)??a(layer-node resolution), and the crash means the visit callback received anundefinedlayer node — i.e. some service layer in 1.18.30 has anundefinedentry in itsdependencies. - It happens during
SystemPrompt.environment→ location-service boot for the session directory. The log repeatedly showsbooting location services. - I could not reproduce any config dependency: the crash persists with (a) all plugins removed, (b) all MCP servers removed, (c) a fresh
XDG_DATA_HOME/XDG_CONFIG_HOME, and (d)env -iwith a minimal environment. This suggests the broken layer dependency is unconditional on this platform.
Reproduction
macOS 15 (Darwin 27.0.0, arm64, Homebrew install):
opencode run "say hi" # v1.18.30 -> UnknownError; log shows the TypeError above
# same command with v1.18.20 binary -> works
Environment
- opencode 1.18.30 (Homebrew,
1.18.30_1), macOS arm64 (Apple Silicon) - Provider: zai-coding-plan (GLM), 7 MCP servers configured
- Logs show sporadic one-off occurrences of the same error on earlier versions (~1/month since July), but v1.18.30 makes it 100% reproducible.
Happy to provide full logs or test a fix build.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.