Skip to content

opentui: fatal: undefined is not an object (evaluating 'agents()[0]') #9692

Closed

Description

@simondmorias

Description

Error when remote attaching to opencode serve in a devcontainer in GitHub CodeSpaces.

TypeError: undefined is not an object (evaluating 'agents()[0]')
    at <anonymous> (src/cli/cmd/tui/context/local.tsx:38:25)
    at init (src/cli/cmd/tui/context/local.tsx:35:19)
    at provider (src/cli/cmd/tui/context/helper.tsx:8:26)
    at untrack (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:475:12)
    at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3)
    at devComponent (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:593:3)
    at children (src/cli/cmd/tui/context/helper.tsx:18:24)
    at <anonymous> (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:1057:29)
    at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3)
    at createMemo (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:273:10)
    at children (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:616:20)
    at untrack (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:475:12)
    at <anonymous> (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:1052:36)
    at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3)
    at createRenderEffect (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:240:75)
    at provider (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:1052:5)
    at untrack (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:475:12)
    at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3)
    at devComponent (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:593:3)
    at <anonymous> (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:1531:21)
    at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3)
    at runTop (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:833:7)
    at runQueue (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:904:42)
    at completeUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:860:84)
    at runUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:850:5)
    at setStore (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:221:5)
    at <anonymous> (src/cli/cmd/tui/context/theme.tsx:234:11)
    at <anonymous> (native:19:28)
    at processTicksAndRejections (native:7:39)...

Plugins

No response

OpenCode version

1.1.27

Steps to reproduce

  1. Start opencode on GitHub CodeSpace (opencode serve --hostname 0.0.0.0)
  2. attach from laptop (opencode attach https://xxxx.app.github.dev

Screenshot and/or share link

No response

Operating System

macOs

Terminal

Ghostty

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 20, 2026
  2. github-actions commented on Jan 20, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    All of these appear to be caused by the agents array not being properly initialized during startup or remote attach scenarios. Feel free to ignore if your specific case differs from these.

  3. R44VC0RP commented on Jan 24, 2026

    @R44VC0RP
    Contributor

    Closing as duplicate of #7918. This is the same root cause - agents array is empty or not loaded during startup. The tracking issue #7918 has root cause analysis.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions