Skip to content

Custom provider with @ai-sdk/openai-compatible silently hangs — request never sent to server #14956

Closed as duplicate

Description

@flood-runner

Description

What happened

Using a custom OpenAI-compatible provider (LiteLLM proxying to Ollama), OpenCode hangs indefinitely after showing build · <model>. The HTTP request never reaches the server.

Config

{
  "provider": {
    "example-llm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Example LiteLLM",
      "options": {
        "baseURL": "https://llm.example.com/v1",
        "apiKey": "{env:LITELLM_MASTER_KEY}"
      },
      "models": {
        "qwen2.5-7b": {
          "id": "qwen2.5:7b",
          "name": "qwen2.5:7b (self-hosted via LiteLLM)",
          "limit": {
            "context": 32768,
            "output": 8192
          }
        }
      }
    }
  }
}

Plugins

None

OpenCode version

1.2.10

Steps to reproduce

  1. Configure a custom provider as above with a working LiteLLM endpoint
  2. Manually install @ai-sdk/openai-compatible in ~/.opencode/ (it wasn't auto-installed)
  3. Run opencode run -m example-llm/qwen2.5-7b "say hi"
  4. OpenCode shows > build · qwen2.5-7b and hangs forever

What I verified

  • Server is reachable: curl with stream:true returns SSE chunks correctly
  • Non-streaming works: curl without streaming returns complete response
  • Config is correct: opencode debug config shows the resolved provider with correct apiKey and baseURL
  • Server logs show no request: while OpenCode hangs, no POST appears in LiteLLM's access log — the request never leaves OpenCode
  • Package is installed: @ai-sdk/openai-compatible@2.0.30 is in ~/.opencode/node_modules/
  • Provider is recognized: logs show service=provider providerID=example-llm found

Expected behavior

OpenCode should send the request to the configured baseURL and stream the response, or show an error if something fails.

Actual behavior

Silent hang with no error, no log output, no request to server.

Screenshot and/or share link

No response

Operating System

ProductName: macOS; ProductVersion: 15.7.3; BuildVersion: 24G419

Terminal

VSCode integrated terminal

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 24, 2026
  2. github-actions commented on Feb 24, 2026

    @github-actions
    Contributor

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

    Please review those issues to see if your problem is already tracked there.

  3. flood-runner commented on Feb 24, 2026

    @flood-runner
    Author
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 workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions