Skip to content

[Bug] Opencode wont start with this plugin 1.14.46 #24

Open

Description

@Ajaymamtora

Using opencode v1.14.46, startup fails

13:14:31 [ajaym] in ~/.config/opencode  oc
Error: 1 of 5 requests failed: config.get: opencode server GET http://opencode.internal/config?directory=%2FUsers%2Fuser%2F.config%2Fopencode → 400: (empty response body)
    at DA (/$bunfs/root/chunk-yds7xgfj.js:469:644)
    at <anonymous> (/$bunfs/root/chunk-yds7xgfj.js:469:6060)
    at processTicksAndRejections (native:7:39)

Activity

  1. HumanError13 commented on May 11, 2026

    @HumanError13

    I receive a similar error, when I try to start opencode TUI:

    Error: 1 of 5 requests failed: config.get: Expected "text" | "audio" | "image" | "video" | "pdf", got "embedding"
      at ["provider"]["lmstudio"]["models"]["text-embedding-nomic-embed-text-v1_5"]["modalities"]["output"][0]
        at ej (B:/~BUN/root/chunk-5e1nbvt1.js:469:644)
        at <anonymous> (B:/~BUN/root/chunk-5e1nbvt1.js:469:6060)
        at processTicksAndRejections (native:7:39)
    
  2. johannesrave commented on May 12, 2026

    @johannesrave

    TLDR: claude thinks it's because i have an embedding model hosted on lm studio as well, and when opencode or this plugin do model discovery, the model is exposed with the modality embedding - but opencode only accepts "text" | "audio" | "image" | "video" | "pdf", got "embedding".
    it is unclear why this happens now, but the working theory is that while opencode never accepted embedding as a value here, it also didnt enforce it (but does now).

    trying to throw out nomic as a quick fix now, but i think it's included with lm-studio per default? the other fast pathway would be to not use this plugin and hardcode the models instead of doing discovery.

    Summary

    After updating opencode from 1.14.30 to 1.14.46, the plugin causes opencode to fail startup with an HTTP 400 on GET /config because it registers embedding-only models (e.g. text-embedding-nomic-embed-text-v1.5) with modalities.output: ["embedding"], which is not an accepted value in opencode's config schema.

    This worked fine on 1.14.30. opencode 1.14.47 notes "HTTP API schema validation errors now return a readable 400 response body" — i.e. the schema was already strict, but is now actively enforced/surfaced. The plugin itself hasn't changed (npm shows 0.3.0 from ~5 months ago); the breakage is triggered by opencode tightening validation.

    Error

    From ~/.local/share/opencode/log/:

    service=default http.method=GET http.url=/config http.status=400 cause=HttpApiSchemaError: Body {
      [cause]: SchemaError: Expected "text" | "audio" | "image" | "video" | "pdf", got "embedding"
        at ["provider"]["lmstudio"]["models"]["text-embedding-nomic-embed-text-v1_5"]["modalities"]["output"][0]
    }
    

    The TUI shows:

    Error: 1 of 5 requests failed: config.get: opencode server GET http://opencode.internal/config?directory=... → 400: (empty response body)
    

    opencode does not start.

    Reproduction

    1. opencode 1.14.46 (also reproduces on 1.14.47)
    2. opencode-lmstudio 0.3.0 enabled as a plugin
    3. LM Studio running on 127.0.0.1:1234 with an embedding model loaded (e.g. nomic-embed-text-v1.5) alongside chat models
    4. Run opencode in any project directory

    Minimal config:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-lmstudio"],
      "provider": {
        "lmstudio": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "LM Studio (local)",
          "options": { "baseURL": "http://127.0.0.1:1234/v1" }
        }
      }
    }

    Expected behavior

    opencode starts. Embedding models exposed by LM Studio should either be filtered out (they're not usable as a chat/coding agent target) or registered without a modalities field — opencode's schema currently only accepts text | audio | image | video | pdf as output modalities.

    Suggested fix

    In the model categorization / config-merge logic (the same area as #7), detect embedding models from LM Studio's /v1/models response and either:

    • skip them entirely when populating provider.lmstudio.models, or
    • emit them without modalities (or with an empty/omitted modalities.output) so the schema validator doesn't reject them.

    LM Studio tags embedding models clearly in /v1/models (type: "embeddings" on the newer API, or model name prefix text-embedding-* as a fallback), so the filter is straightforward.

    Workaround

    Ejecting the embedding model in LM Studio, or downgrading opencode to 1.14.30, both make startup succeed. Neither is desirable long-term — embeddings in LM Studio are useful for other tools, and pinning opencode means missing fixes.

    Environment

    • opencode 1.14.46 (also 1.14.47)
    • opencode-lmstudio 0.3.0
    • LM Studio (latest), serving on 127.0.0.1:1234
    • macOS, bun runtime (as bundled with opencode)

    Happy to test a patch.

  3. shawonashraf commented on May 18, 2026

    @shawonashraf
    Contributor

    Can't we just change it here?

    export type ModelType = 'chat' | 'embedding' | 'unknown'

  4. DanTulovsky commented on Jun 11, 2026

    @DanTulovsky

    Is there a fix for this? In my case the embedding model isn't even. loaded... but still shows in the list. Seemingly another bug: lmstudio-ai/lmstudio-bug-tracker#763

  5. shawonashraf commented on Jun 11, 2026

    @shawonashraf
    Contributor

    Is there a fix for this? In my case the embedding model isn't even. loaded... but still shows in the list. Seemingly another bug: lmstudio-ai/lmstudio-bug-tracker#763

    This projects seems kinda abandoned. No reply on issues or PRs from the maintainers. I wrote my own plugin instead. See if it works for you.

    https://github.com/rashomon-gh/opencode-lmstudio-sync

  6. AmeNatsu001 commented on Jun 11, 2026

    @AmeNatsu001

    I ran into the exact same issue while using this plugin. Then I realized that OpenCode already has native support for LM Studio local models, so it looks like this plugin is no longer needed and can just be uninstalled.

  7. trigger2k20 commented on Jun 12, 2026

    @trigger2k20
    Contributor

    I ran into the exact same issue while using this plugin. Then I realized that OpenCode already has native support for LM Studio local models, so it looks like this plugin is no longer needed and can just be uninstalled.

    You sure ? I did not succeed...
    I made a fork of this project to fix it and to work with an API key. This fork also supports "on the fly" modell list.

  8. DanTulovsky commented on Jun 12, 2026

    @DanTulovsky
  9. trigger2k20 commented on Jun 12, 2026

    @trigger2k20
    Contributor

    HI @DanTulovsky , the fork and pending upstream PR are available here:

    Fork:
    https://github.com/trigger2k20/opencode-lmstudio

    Pull request:
    #29

    The PR dynamically queries LM Studio through /v1/models, filters embedding
    models from the OpenCode chat-model list, supports authenticated LM Studio
    servers, and removes stale built-in models through the generated whitelist.

    It has not been merged or published yet, so installing "opencode-lmstudio"
    normally will not include these changes.

  10. shawonashraf commented on Jun 13, 2026

    @shawonashraf
    Contributor

    The built in support doesn't seem to automatically query lm studio.. so you
    have to configure it manually in the config file...

    ──────────────────────────────────────
    dan-generated content may be incorrect
    …

    On Fri, Jun 12, 2026 at 9:36 AM trigger2k20 @.***> wrote:
    trigger2k20 left a comment (agustif/opencode-lmstudio#24)
    <(earlier comment)>

    I ran into the exact same issue while using this plugin. Then I realized
    that OpenCode already has native support for LM Studio local models, so it
    looks like this plugin is no longer needed and can just be uninstalled.

    You sure ? I did not succeed...
    I made a fork of this project to fix it and to work with an API key. This
    fork also supports "on the fly" modell list.

    —
    Reply to this email directly, view it on GitHub
    <#24?email_source=notifications&email_token=AAD4PPY5M7FQS37LZ2HPLQT47QBOBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRZGE3TMMZRGE3KM4TFMFZW63VGNVQW45LBNSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4691763116>,
    or unsubscribe
    <github.com/notifications/unsubscribe-auth/AAD4PPYRIWB4BULSNYMJQM347QBOBAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMJUG44TGMZYHA5US43TOVSTWNBUGE2TKNZXGU2TTILWAI>
    .
    You are receiving this because you are subscribed to this thread.Message
    ID: @.***>

    In that case there's no use of this plugin at all! And why's this some agent generated reply? Is this project that abandoned? At least approve qualifying PRs!

  11. shawonashraf commented on Jun 13, 2026

    @shawonashraf
    Contributor

    @agustif I understand that you may be a busy person but you can also let give others priveleged access to review and approve pull requests. :)

  12. trigger2k20 commented on Jun 13, 2026

    @trigger2k20
    Contributor

    The built in support doesn't seem to automatically query lm studio.. so you
    have to configure it manually in the config file...
    ──────────────────────────────────────
    dan-generated content may be incorrect
    …
    On Fri, Jun 12, 2026 at 9:36 AM trigger2k20 @.> wrote:
    trigger2k20 left a comment (agustif/opencode-lmstudio#24)
    <(earlier comment)>
    I ran into the exact same issue while using this plugin. Then I realized
    that OpenCode already has native support for LM Studio local models, so it
    looks like this plugin is no longer needed and can just be uninstalled.
    You sure ? I did not succeed...
    I made a fork of this project to fix it and to work with an API key. This
    fork also supports "on the fly" modell list.
    —
    Reply to this email directly, view it on GitHub
    <#24?email_source=notifications&email_token=AAD4PPY5M7FQS37LZ2HPLQT47QBOBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRZGE3TMMZRGE3KM4TFMFZW63VGNVQW45LBNSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4691763116>,
    or unsubscribe
    <github.com/notifications/unsubscribe-auth/AAD4PPYRIWB4BULSNYMJQM347QBOBAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMJUG44TGMZYHA5US43TOVSTWNBUGE2TKNZXGU2TTILWAI>
    .
    You are receiving this because you are subscribed to this thread.Message
    ID: _
    @
    _.**>

    In that case there's no use of this plugin at all! And why's this some agent generated reply? Is this project that abandoned? At least approve qualifying PRs!
    @rashomon-gh Do you mean by "built" my Fork ? Did you try it ?

  13. agustif commented on Jun 13, 2026

    @agustif
    Owner

    approved #28

    sorry hadn't seen this earlier

    gonna go through all the PR's now

  14. trigger2k20 commented on Jun 14, 2026

    @trigger2k20
    Contributor

    @agustif Thank you for reviewing and merging PR #29.

    One remaining documentation/release issue: the README already recommends opencode-lmstudio@0.3.1, but npm currently still provides 0.3.0 as latest. Therefore, users following the README cannot install version 0.3.1 yet and will receive the previous package without the merged changes.

    Therefore, please publish opencode-lmstudio@0.3.1 to npm, thanks.

  15. devAGMi commented on Jun 15, 2026

    @devAGMi

    I receive a similar error, when I try to start opencode TUI:

    Error: 1 of 5 requests failed: config.get: Expected "text" | "audio" | "image" | "video" | "pdf", got "embedding"
      at ["provider"]["lmstudio"]["models"]["text-embedding-nomic-embed-text-v1_5"]["modalities"]["output"][0]
        at ej (B:/~BUN/root/chunk-5e1nbvt1.js:469:644)
        at <anonymous> (B:/~BUN/root/chunk-5e1nbvt1.js:469:6060)
        at processTicksAndRejections (native:7:39)
    

    Is there a fix for this? In my case the embedding model isn't even. loaded... but still shows in the list. Seemingly another bug: lmstudio-ai/lmstudio-bug-tracker#763

    You can fix the error by adding the following to opencode.json:

    "models": {
    "text-embedding-nomic-embed-text-v1_5": {
    "modalities": {
    "output": ["text"]
    }
    }
    }

  16. Pesterenan commented on Jun 19, 2026

    @Pesterenan

    What worked for me was adding this config under the provider.lmstudio field, together with an 'input' field:
    "provider": { "lmstudio": { "models": { "text-embedding-nomic-embed-text-v1_5": { "modalities": { "input": ["text"], "output": ["text"] } } } } },
    But we should have patience and wait for the developer fix too. Thanks for the cool plugin!

  17. agustif commented on Jun 21, 2026

    @agustif
    Owner

    Published — opencode-lmstudio@0.3.1 is now live on npm, and latest now resolves to 0.3.1.

    Thanks again for PR #29 and for flagging the missing npm release.

  18. agustif commented on Jun 21, 2026

    @agustif
    Owner

    opencode-lmstudio@1.0.0-rc.1 is now available and contains the typed-discovery fix for the startup failure reported in this thread.

    The RC reads LM Studio's GET /api/v0/models metadata, registers only models reported as llm or vlm, and omits embeddings records from OpenCode's chat provider. It never emits "embedding" as an OpenCode output modality. The public npm package has passed real OpenCode startup and model-picker tests against a fixture containing LLM, VLM, and embedding records.

    Could affected users retest with the exact RC, including setups where the embedding model is downloaded but not loaded?

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

    Please report your OpenCode and LM Studio versions and whether startup, model selection, and chat now work without a manual embedding override. If the original validation error is gone, please confirm that this issue can be closed. If it persists, include the first current validation error and the sanitized embedding record returned by /api/v0/models.

    The complete RC release matrix and reporting template are in #34.

  19. agustif commented on Jun 21, 2026

    @agustif
    Owner

    opencode-lmstudio@1.0.0-rc.2 includes loaded and unloaded embedding records in its startup regression fixtures.

    Native /api/v1/models records with type: "llm" enter the chat provider; type: "embedding" records are excluded, so they cannot produce an invalid OpenCode chat modality. The public package passed clean-cache startup, model picker, and chat tests. This RC requires OpenCode 1.17.7 or newer; the originally reported 1.14.46 is below the supported minimum.

    Please upgrade OpenCode, pin "plugin": ["opencode-lmstudio@1.0.0-rc.2"], restart, and test with your embedding model present in both downloaded/unloaded and loaded states if possible. If startup and chat now work without a manual override, please confirm this issue can be closed. If not, include the first current validation error and the sanitized embedding record. See #34 for the shared template.

  20. self-assigned this
    on Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions