anomalyco / anomalyco/opencode

macOS: every prompt fails with "undefined is not an object (evaluating 'a.name')"

Open
#48,811 10 comments 47 reactions 1 assignee View on GitHub

@rekram1-node 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

macOS: every prompt fails with undefined is not an object

OpenCode starts successfully and creates a session, but every prompt/tool
invocation fails with:

TypeError: undefined is not an object (evaluating 'a.name')

The error occurs in SystemPrompt.environment.

Environment
  • OpenCode: 1.18.30
  • Installation: Homebrew (/opt/homebrew/bin/opencode)
  • macOS Darwin: 24.6.0
  • Architecture: arm64
  • Shell: /bin/zsh
  • Terminal: xterm-256color
  • Model: opencode-go/glm-5.3-flash
  • Plugins: none
  • LSPs and formatters: disabled
Actual behavior

The prompt fails with:

TypeError: undefined is not an object (evaluating 'a.name')
    at resolve (/$bunfs/root/chunk-36bwgd4p.js:2:1659)
    ...
    at SystemPrompt.environment
    at SessionPrompt.run

The error reproduces with a clean configuration:

XDG_CONFIG_HOME="$(mktemp -d)" \
XDG_DATA_HOME="$(mktemp -d)" \
opencode
Additional information

OpenCode also reports:

Failed to fetch models.dev
cause=Cause([Fail(TimeoutError)])

However, OpenCode itself starts successfully. The main issue is the
reproducible a.name TypeError when sending a prompt.

Before the update everything worked just fine.

Plugins

none

OpenCode version

1.18.30

Steps to reproduce
  1. Start OpenCode in any directory.
  2. Create a new session.
  3. Send any prompt.
Screenshot and/or share link
Image
Operating System

macOS 15.7.9

Terminal

Ghostty

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.