anomalyco / anomalyco/opencode

SystemPrompt.environment crashes on every prompt: undefined is not an object (evaluating 'a.name')

Open
#48,965 3 comments 22 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 14, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

OpenCode fails before sending any prompt to the model. The UI shows:

Failed to send prompt
Unexpected server error. Check server logs for details.

The server log shows:

TypeError: undefined is not an object (evaluating 'a.name')
at SystemPrompt.environment
at SessionPrompt.run
at SessionPrompt.prompt

The error occurs repeatedly for new sessions and different working directories.

Plugins

no

OpenCode version

1.18.30

Steps to reproduce
opencode --pure --print-logs --log-level DEBUG run "Reply with exactly: OK"

Observed output:

timestamp=2026-09-14T10:33:47.470Z level=ERROR run=72d3ed46 message=failed ref=err_1005f375 error="TypeError: undefined is not an object (evaluating 'a.name')" cause="TypeError: undefined is not an object (evaluating 'a.name')\n    at resolve (/$bunfs/root/chunk-36bwgd4p.js:2:1659)\n    at a (/$bunfs/root/chunk-36bwgd4p.js:2:936)\n    at map (native:1:11)\n    at <anonymous> (/$bunfs/root/chunk-36bwgd4p.js:2:1626)\n    at a (/$bunfs/root/chunk-36bwgd4p.js:2:1166)\n    at map (native:1:11)\n    at <anonymous> (/$bunfs/root/chunk-36bwgd4p.js:2:1626)\n    at a (/$bunfs/root/chunk-36bwgd4p.js:2:1166)\n    at map (native:1:11)\n    at <anonymous> (/$bunfs/root/chunk-36bwgd4p.js:2:1390)\n    at SystemPrompt.environment (/$bunfs/root/chunk-n59f7cwr.js:50:13096)\n    at SystemPrompt.environment (definition) (/$bunfs/root/chunk-n59f7cwr.js:4:14254)\n    at SessionPrompt.run (/$bunfs/root/chunk-n59f7cwr.js:50:14576)\n    at SessionPrompt.run (definition) (/$bunfs/root/chunk-n59f7cwr.js:50:10099)\n    at SessionRunState.ensureRunning (/$bunfs/root/chunk-n59f7cwr.js:50:14545)\n    at SessionRunState.ensureRunning (definition) (/$bunfs/root/chunk-n59f7cwr.js:2:6720)\n    at SessionPrompt.loop (/$bunfs/root/chunk-n59f7cwr.js:50:9849)\n    at SessionPrompt.loop (definition) (/$bunfs/root/chunk-n59f7cwr.js:50:14481)\n    at SessionPrompt.prompt (/$bunfs/root/chunk-p2p9kfnt.js:6:11695)\n    at SessionPrompt.prompt (definition) (/$bunfs/root/chunk-n59f7cwr.js:50:9462)"
Error: {
  "name": "UnknownError",
  "data": {
    "message": "Unexpected server error. Check server logs for details.",
    "ref": "err_1005f375"
  }
}
Screenshot and/or share link

No response

Operating System

macOS 27.0(Apple Silicon)

Terminal

zsh

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.