Skip to content

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

Description

@mejiro-rin

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions