Skip to content

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

Closed

Description

@tsopito

Description

TypeError: undefined is not an object (evaluating 'agents()[0].name')
    at <anonymous> (src/cli/cmd/tui/context/local.tsx:53:27)
    at init (src/cli/cmd/tui/context/local.tsx:50: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)...

OpenCode version

1.0.174

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

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

    @github-actions
    Contributor

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

    Both issues suggest that the problem is in src/cli/cmd/tui/context/local.tsx where agents()[0].name is accessed without checking if agents array is empty or defined. This happens when no agents are available to the current session.

    Feel free to ignore if your specific case is different from these scenarios (e.g., remote connection or disabled agents).

  3. rekram1-node commented on Dec 20, 2025

    @rekram1-node
    Contributor

    @tsopito can u share:

    opencode debug config

  4. rekram1-node commented on Dec 20, 2025

    @rekram1-node
    Contributor

    It looks like all ur primary agents are disabled, Ill adjust the code so we have cleaner error for this but this is a config issue on ur end

  5. rekram1-node commented on Dec 20, 2025

    @rekram1-node
    Contributor

    Should fix it (as in better error):
    d61b04a

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