Skip to content

Crash when local.agent.current() returns undefined during startup/auth #7918

Closed

Description

@tdawe1

Description

OpenCode crashes with TypeError: undefined is not an object when:

  1. Using authentication plugins like opencode-antigravity-auth
  2. The agents array is empty or not yet loaded during startup

Stack Traces

TypeError: undefined is not an object (evaluating 'local.agent.current().name') at (src/cli/cmd/tui/component/prompt/index.tsx:840)

TypeError: undefined is not an object (evaluating 'a6.name')
at (src/cli/cmd/tui/context/local.tsx:151)

Root Cause

Multiple places in prompt/index.tsx and local.tsx access .name on potentially undefined objects.

Environment

  • OpenCode version: 1.1.13
  • OS: Arch Linux

Activity

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

    @github-actions
    Contributor

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

    All of these involve the same error: 'local.agent.current()' returning undefined, occurring during authentication or provider connection. They all share similar stack traces pointing to prompt/index.tsx:840.

    Feel free to ignore if this addresses your specific case differently than these others.

  3. dhruvkej9 commented on Jan 15, 2026

    @dhruvkej9

    @rekram1-node @thdxr This issue is also on version 1.1.21

    Occured for me while doing /connect and after the github copilot auth was successful

  4. rekram1-node commented on Jan 15, 2026

    @rekram1-node
    Contributor

    Yeah trying to figure this out is annoying, cant replicate at all

  5. dhruvkej9 commented on Jan 15, 2026

    @dhruvkej9

    Yeah trying to figure this out is annoying, cant replicate at all

    Try doing /connect with copilot models using opencode-copilot-auth@0.0.11 on opencode@1.1.21

    after entering code on github website, when you comeback to opencode you should see this.

  6. rekram1-node commented on Jan 15, 2026

    @rekram1-node
    Contributor

    Yeah did this several times, cannot replicate.

    What OS are you using

  7. dhruvkej9 commented on Jan 16, 2026

    @dhruvkej9

    Yeah did this several times, cannot replicate.

    What OS are you using

    I am using Ubuntu 24.04 on WSL2 in Windows 11

    (Windows Terminal)

  8. jamshidkhaksaar commented on Jan 21, 2026

    @jamshidkhaksaar

    is this issue resolved?

  9. github-actions commented on Mar 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  10. dhruvkej9 commented on Mar 28, 2026

    @dhruvkej9

    @rekram1-node It is again coming in version 1.3.3, when connecting to auth provider (I did OpenAI Codex)

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

Metadata

Metadata

Assignees

Labels

opentuiThis 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