anomalyco / anomalyco/opencode

TUI crash: U.split is not a function. (In 'U.split("/")', 'U.split' is undefined)

Open
#48,957 0 comments 0 reactions 1 assignee View on GitHub

@simonklee 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

TUI crashes on startup with U.split is not a function. Happens intermittently when launching with -m <provider>/<model> pointed at a custom (non-catalog) @ai-sdk/openai-compatible provider defined in opencode.json — not on every launch, roughly 1 in a few tries. Restarting (r on the crash screen) usually gets a clean session.

opencode run -m <same provider>/<same model> (headless) never reproduces this — only the interactive TUI.

Config provider block in use:

{
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama (local)",
      "options": { "baseURL": "http://localhost:11434/v1", "apiKey": "ollama" },
      "models": {
        "qwen2.5-coder:7b": { "name": "Qwen2.5 Coder 7B", "tools": true },
        "qwen3.5:9b": { "name": "Qwen3.5 9B", "tools": true }
      }
    }
  }
}

I traced this as far as I could in the source without shipped sourcemaps: the stack trace's providerchildren → nested createMemo shape points at packages/tui/src/context/local.tsx's parseModel() / fallbackModel memo, but every call site I found there (args.model, sync.data.config.model) is already guarded with a truthy-string check before .split("/"), so I couldn't pin the exact unguarded call from source alone. Possibly related to the unguarded-split pattern already tracked in #43662 (that one's in the desktop packages/app, not packages/tui, so likely a distinct instance of the same class of bug).

Plugins

None (--pure not used, but no plugins configured)

OpenCode version

1.18.30

Steps to reproduce
  1. Configure a custom @ai-sdk/openai-compatible provider in opencode.json (e.g. Ollama) with 2+ models.
  2. Launch opencode -m <provider>/<model> repeatedly from a bash alias.
  3. Crash occurs intermittently on startup, before the prompt renders.
Operating System

Linux 7.2.3-ogc4.1.fc44.x86_64 (x64)

Terminal

xterm-256color

Stack trace
TypeError: U.split is not a function. (In 'U.split("/")', 'U.split' is undefined)
    at _i (/$bunfs/root/chunk-wt1x2xyt.js:2:7922)
    at <anonymous> (/$bunfs/root/chunk-wt1x2xyt.js:2:9889)
    at mJ (/$bunfs/root/chunk-zwn33msg.js:2:9650)
    at p (/$bunfs/root/chunk-zwn33msg.js:2:9431)
    at sJ (/$bunfs/root/chunk-zwn33msg.js:2:8440)
    at b (/$bunfs/root/chunk-wt1x2xyt.js:2:8427)
    at <anonymous> (/$bunfs/root/chunk-wt1x2xyt.js:2:10336)
    at mJ (/$bunfs/root/chunk-zwn33msg.js:2:9650)
    at p (/$bunfs/root/chunk-zwn33msg.js:2:9431)
    at F (/$bunfs/root/chunk-zwn33msg.js:2:3993)
    at A (/$bunfs/root/chunk-wt1x2xyt.js:2:10304)
    at init (/$bunfs/root/chunk-wt1x2xyt.js:2:12771)
    at provider (/$bunfs/root/chunk-cvwha8nb.js:2:116982)
    at b (/$bunfs/root/chunk-zwn33msg.js:2:6673)
    at children (/$bunfs/root/chunk-cvwha8nb.js:2:117118)
    at <anonymous> (/$bunfs/root/chunk-zwn33msg.js:2:14138)
    at mJ (/$bunfs/root/chunk-zwn33msg.js:2:9650)
    at p (/$bunfs/root/chunk-zwn33msg.js:2:9431)
    at F (/$bunfs/root/chunk-zwn33msg.js:2:3993)
    at vJ (/$bunfs/root/chunk-zwn33msg.js:2:7957)
    at b (/$bunfs/root/chunk-zwn33msg.js:2:6673)
    at <anonymous> (/$bunfs/root/chunk-zwn33msg.js:2:14080)
    at mJ (/$bunfs/root/chunk-zwn33msg.js:2:9650)
    at p (/$bunfs/root/chunk-zwn33msg.js:2:9431)
    at dJ (/$bunfs/root/chunk-zwn33msg.js:2:3567)
    at <anonymous> (/$bunfs/root/chunk-zwn33msg.js:2:14072)
    at b (/$bunfs/root/chunk-zwn33msg.js:2:6673)
    at <anonymous> (/$bunfs/root/chunk-zwn33msg.js:2:19878)
    at mJ (/$bunfs/root/chunk-zwn33msg.js:2:9650)
    at p (/$bunfs/root/chunk-zwn33msg.js:2:9431)
    at ZJ (/$bunfs/root/chunk-zwn33msg.js:2:11057)
    at rJ (/$bunfs/root/chunk-zwn33msg.js:2:11931)
    at yZ (/$bunfs/root/chunk-zwn33msg.js:2:11333)
    at w (/$bunfs/root/chunk-zwn33msg.js:2:11238)
    at e (/$bunfs/root/chunk-cvwha8nb.js:2:113598)
    at <anonymous> (/$bunfs/root/chunk-cvwha8nb.js:2:120322)
    at processTicksAndRejections (native:7:39)

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.