Skip to content

Built-in vLLM discovery causes recurring 401 requests to oMLX on port 8000 #54347

Closed as duplicate

Description

@trigger2k20

OpenCode v2.0.26 on macOS Apple Silicon automatically polls an authenticated oMLX server at http://127.0.0.1:8000/v1 every 30 seconds, producing GET /v1/models → 401: API key required.

oMLX is configured as a separate custom OpenAI-compatible provider with a valid API key. Chat completions work. I do not use vLLM.

Reproduction:

  1. Run oMLX with API-key authentication on port 8000.
  2. Configure the omlx provider with its API key and baseURL.
  3. Start the OpenCode background service.
  4. Observe recurring 401 messages in the oMLX logs.

Stopping the OpenCode service stops these requests. Adding an explicit Authorization header to the omlx provider does not resolve them.

Confirmed workaround:
Add "plugins": ["-opencode.provider.vllm"] at the configuration root, then restart the service. No new 401 messages appeared during approximately two minutes with the service running.

Source analysis at commit 9b4ec57:

  • packages/core/src/plugin/provider/vllm.ts:14–26 defaults to port 8000 and requests /health and /v1/models.
  • packages/core/src/plugin/provider/local.ts:34 sets a 30-second interval.
  • local.ts:113–116 ignores discovery errors and continues polling.
  • local.ts:142–193 uses the discovery provider API key.
  • configured.ts:15–19 selects settings by provider ID, so omlx credentials do not authenticate the separate vllm probe.

Expected behavior: Avoid indefinitely polling an authenticated non-vLLM server merely because it occupies port 8000. Consider opt-in discovery, endpoint collision detection, or backoff after authentication failures.

Activity

  1. opencode-agent commented on Oct 10, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and source analysis! I think this is a duplicate of #45172, which reports the same thing: OpenCode polls whatever is listening on localhost:8000 every 30 seconds and keeps going even when every request fails. A comment there traces it to the built-in vLLM discovery plugin and gives the same workaround you found ("plugins": ["-opencode.provider.vllm"]). The only difference is the status code. Your oMLX server answers /health successfully, so the probe goes on to /v1/models and gets a 401 there, while in #45172 it stopped at a 404 on /health.

    Possible duplicates and related issues, ordered by likelihood:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Your suggestions (opt-in discovery, backoff after auth failures, collision detection) would be useful additions on #45172.

  2. opencode-agent commented on Oct 11, 2026

    @opencode-agent
    Contributor

    We haven't heard back, so I'm closing this as a duplicate of #45172. Both are caused by the built-in vLLM discovery plugin polling localhost:8000 every 30 seconds without backing off. Please follow #45172 for updates. Your suggestions (opt-in discovery, backoff after auth failures, endpoint collision detection) would be useful additions there. Until then, the workaround you found still applies: add "plugins": ["-opencode.provider.vllm"] to your config. If your problem turns out to be different, reply here and we can reopen. Thanks for the detailed report!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions