Skip to content

[Bug] Unusable with Authentication #41

Description

@LockBlock-dev

Using latest RC2 opencode-lmstudio@1.0.0-rc.2 with lmstudio 0.4.18 (Build 1) and opencode 1.17.11, lmstudio server started with Require Authentication.

opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-lmstudio@1.0.0-rc.2"]
}

Trying to connect lmstudio provider in OpenCode with a fresh API token, I get the following logs in lmstudio and the plugin silently falls back to /v0 and lists none of my models.

2026-06-29 18:27:39 [DEBUG]
 Received request: GET to /api/v1/models
2026-06-29 18:27:39 [ERROR]
 [LM STUDIO SERVER]  {
  "error": {
    "type": "invalid_request",
    "code": "invalid_api_key",
    "message": "An LM Studio API token is required to make requests to this server, but none was provided using the Authorization header using the 'Bearer' scheme (i.e., 'Authorization: Bearer $LM_API_TOKEN'). Learn more at: https://lmstudio.ai/docs/developer/core/authentication."
  }
}
2026-06-29 18:27:40 [DEBUG]
 Received request: GET to /api/v0/models

in auth.json i can see my token was added correctly though:

...
  "lmstudio": {
    "type": "api",
    "key": "sk-lm-XXXXXXXXX"
  }
...
  • opencode-lmstudio@0.3.1 errors with sk-lm-J9Fa6fbC:jkFcl7oqhmx5GB1eM5fL.
  • opencode-lmstudio@1.0.0-rc.1 does not trigger an error and silently fails.
  • opencode-lmstudio@1.0.0-rc.2 triggers an error (sent above) and silently fails.

This plugin barely worked for me in very early versions before we got capabilities in lmstudio and hasnt worked since then because of various errors...

Related to #34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions