GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — opentui: TUI crashes after successful native OpenAI account connection (TypeError: local.agent.current() is undefined) · Issue #7550 · anomalyco/opencode

opentui: TUI crashes after successful native OpenAI account connection (TypeError: local.agent.current() is undefined) #7550

New issue
Copy link
New issue
Copy link
Closed
Closed
opentui: TUI crashes after successful native OpenAI account connection (TypeError: local.agent.current() is undefined)#7550
Copy link
Assignees
rekram1-node
Labels
bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Description

@RovshanMuradov
RovshanMuradov
opened on Jan 10, 2026
Issue body actions

Description

Description

After connecting my OpenAI account using the native authentication flow, the OpenAI authorization completes successfully in the browser. However, after returning to the opencode TUI, the application crashes with a fatal error and becomes unusable.

Expected behavior

The TUI should continue working normally and show the connected OpenAI account.

Actual behavior

The TUI crashes with a fatal error immediately after authentication completes.

Error output / stack trace

TypeError: undefined is not an object (evaluating 'local.agent.current().name')
    at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:840:75)
    at <anonymous> (.../node_modules/@opentui/solid/index.js:148:62)
    at runComputation (.../solid-js/dist/dev.js:742:22)
    at updateComputation (.../solid-js/dist/dev.js:724:3)
    at runTop (.../solid-js/dist/dev.js:833:7)
    at runUserEffects (.../solid-js/dist/dev.js:928:18)
    at runUpdates (.../solid-js/dist/dev.js:849:17)
    at completeUpdates (.../solid-js/dist/dev.js:900:17)
    at setStore (.../solid-js/store/dist/dev.js:221:5)
    at processTicksAndRejections (native:7:39)

Environment

  • OS: Arch Linux
  • Node.js: (please fill if known)
  • Bun: 1.3.4
  • Node.js: v25.2.1
  • Shell: fish

Additional context

  • The OpenAI login succeeds (account is authorized on the OpenAI website).
  • The crash happens only after returning to the TUI.
  • Workaround: selecting "Reset TUI" fixes the issue.

Screenshot

Plugins

oh-my-opencode

OpenCode version

opencode version: 1.1.11

Steps to reproduce

  1. Launch opencode
  2. Start native OpenAI account connection from the TUI /connect
  3. Complete authentication successfully in the OpenAI browser flow
  4. Return to the opencode TUI

Screenshot and/or share link

Image

Operating System

Arch Linux

Terminal

Ghossty

Activity

  1. RovshanMuradov
    added
    bugSomething isn't working
    on Jan 10, 2026
  2. github-actions
    assigned
    rekram1-node
    on Jan 10, 2026
  3. github-actions
    added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 10, 2026
  4. github-actions commented on Jan 10, 2026

    @github-actions
    github-actionsBot
    on Jan 10, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • opentui: fatal: undefined is not an object (evaluating 'agents()[0].name') #5830: opentui crash with 'agents()[0].name' undefined - similar pattern of accessing undefined agent data
    • opentui: fatal: undefined is not an object (evaluating 'agents()[0].name') #4111: opentui crash with 'agents()[0].name' undefined - similar agent initialization issue

    While the specific error location differs (your issue is at line 840 accessing 'local.agent.current()' vs #5830/#4111 accessing 'agents()[0].name'), the root cause appears to be the same: agent data is not properly initialized or available when the TUI loads/reloads after authentication flows.

    The common factor is:

    • Crashes occur after some action completes (OpenAI auth in your case, remote attach in opentui: fatal: undefined is not an object (evaluating 'agents()[0].name') #4111)
    • TUI fails when trying to access agent information
    • Error pattern suggests agent context/store is undefined or not yet loaded

    Feel free to ignore if your case is fundamentally different from these, but checking these issues might help identify if this is a broader agent initialization issue in opentui.

  5. chwdy commented on Jan 10, 2026

    @chwdy
    chwdy
    on Jan 10, 2026
    More actions

    exact same issue here

  6. chwdy commented on Jan 10, 2026

    @chwdy
    chwdy
    on Jan 10, 2026
    More actions

    I found a workaround

    • close opencode
    • open a new terminal window
    • opencode auth logout logout openai ( if any)
    • opencode auth login to login openai
    • start opencode, and the provider is properly set up

    looks like it's just the ui problem, things behind the ground was working fine

    Reacted by Rovshan Muradov, 김현준, Fede, SuiFengLai and Ross Timson
  7. RovshanMuradov commented on Jan 10, 2026

    @RovshanMuradov
    RovshanMuradov
    on Jan 10, 2026
    ContributorAuthor
    More actions

    I found a workaround

    * close opencode
    
    * open a new terminal window
    
    * `opencode auth logout` logout openai ( if any)
    
    * `opencode auth login` to login openai
    
    * start opencode, and the provider is properly set up
    

    looks like it's just the ui problem, things behind the ground was working fine

    Make sense, thank you! I will try

  8. R44VC0RP commented on Jan 24, 2026

    @R44VC0RP
    R44VC0RP
    on Jan 24, 2026
    Contributor
    More actions

    Closing as duplicate of #7918. This is the same root cause - local.agent.current() returns undefined during startup/auth. The tracking issue #7918 has root cause analysis.

  9. R44VC0RP
    closed this as completedon Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.