Skip to content

Plugin installation failures are silent, causing OAuth options to disappear #8297

Closed
Barneyjm/opencode
#1

Description

@Barneyjm

Description

Problem

When built-in OAuth plugins (opencode-copilot-auth, opencode-anthropic-auth) fail to install from npm, the error is logged but execution continues silently. Users are left without OAuth authentication options and no indication of what went wrong.

Impact

  • User confusion: OAuth options mysteriously missing for GitHub Copilot, Anthropic, etc.
  • Enterprise environments: Particularly affects users with corporate npm proxies (JFrog, Artifactory, Nexus)
  • Silent failures: Users have no visibility into why authentication methods are unavailable

Root cause

Location: packages/opencode/src/plugin/index.ts:58-75

plugin = await BunProc.install(pkg, version).catch((err) => {
  if (!builtin) throw err
  const message = err instanceof Error ? err.message : String(err)
  log.error("failed to install builtin plugin", {
    pkg,
    version,
    error: message,
  })
  Bus.publish(Session.Event.Error, {
    error: new NamedError.Unknown({
      message: `Failed to install built-in plugin ${pkg}@${version}: ${message}`,
    }).toObject(),
  })
  return ""  // ⚠️ Returns empty string on failure
})
if (!plugin) continue  // ⚠️ Silently skips failed plugin

When builtin plugins fail to install:

  1. Error is logged to console (users rarely see this)
  2. Session.Event.Error is published (not displayed in UI)
  3. Plugin is silently skipped with continue
  4. ProviderAuth.methods() returns no OAuth methods for that provider
  5. UI falls back to API key only with no explanation

Plugins

opencode-copilot-auth, opencode-anthropic-auth

OpenCode version

1.1.17

Steps to reproduce

Reproduction Steps

  1. Set up environment to cause npm install failure:

    Example: point to invalid registry

    npm config set registry https://invalid-registry.example.com/

  2. Start OpenCode:
    opencode

  3. Try to authenticate with GitHub Copilot:
    opencode auth login

    Select "github-copilot"

    Only see "API key" option, no OAuth

    You might need to clear old auth configs

  4. No error message or indication of why OAuth is missing

Expected Behavior

When plugins fail to install, users should:

  1. See a clear warning message explaining the problem
  2. Get actionable steps to fix the issue
  3. Have diagnostic tools to troubleshoot
  4. Understand which authentication methods are unavailable and why

Screenshot and/or share link

Image

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Jan 13, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Jan 13, 2026

    @rekram1-node
    Contributor

    @Barneyjm I believe this is because the server is emitting events before any subscribers can read them

  3. Barneyjm commented on Jan 14, 2026

    @Barneyjm
    Author

    Clicked the wrong thing and closed this issue, sorry

  4. Barneyjm commented on Jan 14, 2026

    @Barneyjm
    Author

    @Barneyjm I believe this is because the server is emitting events before any subscribers can read them

    @rekram1-node Ah ok interesting. I had Claude make a new endpoint for plugin errors so they could be inspected as needed. Would you prefer I add a wait or retry?

  5. Barneyjm commented on Jan 20, 2026

    @Barneyjm
    Author

    @rekram1-node @thdxr please let me know if more changes are needed in this PR or if this is good to merge: #8319

  6. manascb1344 commented on Feb 8, 2026

    @manascb1344

    Facing the same issue!

  7. github-actions commented on Apr 10, 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.

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 working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions