GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — provider discovery: hard-coded 1s timeout fails remote endpoints · Issue #58558 · anomalyco/opencode

provider discovery: hard-coded 1s timeout fails remote endpoints #58558

New issue
Copy link
New issue
Copy link
Closed
#63700
Closed
provider discovery: hard-coded 1s timeout fails remote endpoints#58558
#63700
Copy link
Labels
pending closetriaging

Description

@ynohat
ynohat
opened on Oct 24, 2026
Issue body actions

Summary

Model discovery for the Ollama, LM Studio and vLLM providers gives up after a hard-coded 1-second timeout (Effect.timeout("1 second") in the shared discovery helper). When a configured baseURL takes several seconds to answer, discovery silently returns zero models. The timeout applies to any baseURL, not only local servers. Chat requests through the openai-compatible runtime are not affected, because they don't use this timeout.

Environment

  • opencode version: 2.1.4 (channel: latest)
  • OS: Darwin 25.6.0 (arm64)
  • Terminal: vscode integrated terminal (TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: /bin/zsh
  • Active plugins: built-in vLLM discovery plugin enabled during reproduction (no user plugins)

Reproduction

  1. Configure a provider with settings.baseURL set to a remote OpenAI-compatible endpoint that serves /health and /v1/models. Use the bare form, with no models and no package. Set apiKey through an environment variable.
  2. Route the endpoint through a path with a TCP connect time of about 9 seconds (in my case a zero-trust client tunnel). Measured with curl: time_connect about 9.3s, time_total about 9.8s for both /health and /v1/models. The same endpoint over a direct route answers in about 66 ms.
  3. Start opencode and run opencode api get /api/model, then filter for the provider's models.
  4. Observe zero models for that provider.

After switching to a direct route (about 20 ms connect), the same configuration discovers all models, and max_model_len is used for the context limit. So the failure depends on latency alone.

Expected Behavior

Discovery should tolerate a slow but reachable endpoint. Options include a longer timeout, a timeout that is configurable, or a per-request budget that matches the chat runtime's defaults. A failed discovery should produce a visible WARN or ERROR log entry.

Actual Behavior

Discovery returns no models. The default log (INFO level) has no WARN or ERROR entry for the failed discovery.

Source references (opencode commit df6fb9a, main branch):

  • packages/core/src/plugin/provider/local.ts: get and getJson both wrap requests in Effect.timeout("1 second"). The plugins using this helper are ollama.ts, lmstudio.ts and vllm.ts.
  • packages/core/src/plugin/provider/vllm.ts: discovery calls /health first, so the timeout also blocks the model request.

Additional Context

  • Workaround that works: disable the built-in discovery plugin with "plugins": ["-opencode.provider.vllm"], set package to @opencode/ai/providers/openai-compatible, and list models explicitly under providers.<id>.models.
  • Discovered models get tools: false (per vllm.ts, which does not report tool support), so tool use needs explicit model entries.

Activity

  1. opencode-agent commented on Oct 24, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 24, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the detailed report and the timing measurements!

    I think this is a duplicate of #53341. It reports the same hard-coded Effect.timeout("1 second") in the shared discovery helper (packages/core/src/plugin/provider/local.ts, unchanged in v2.1.4) causing discovery to fail against slow remote endpoints. There the endpoint was a remote Ollama server behind an SSH tunnel, and it already asks for a configurable timeout or a longer one for non-loopback URLs. Your vLLM setup and the zero-models symptom have the same cause.

    Possible duplicates and related issues, ordered by likelihood:

    • [V2] "Unsupported package for ollama/<model>" when Ollama /api/tags takes longer than 1 s (hardcoded discovery timeout) #53341: same 1s discovery timeout failing slow remote endpoints (Ollama over an SSH tunnel; a commenter reports the same with llama.cpp)
    • fix(core): keep configured local models available without discovery #54011: open PR that keeps explicitly configured local models usable when discovery times out. It doesn't change the timeout, so it wouldn't help a bare config with no models
    • providers: vLLM discovery silently drops every model whose owned_by is not "vllm" #57460: another vLLM discovery problem (models dropped when owned_by isn't "vllm")
    • feat(core): discover models for configured OpenAI-compatible providers #57161: PR adding model discovery for configured OpenAI-compatible providers

    The point about logging a WARN or ERROR when discovery fails is a good one. #53341 doesn't mention it, so please add it there.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent
    added
    pending close
    triaging
    on Oct 24, 2026
  3. ynohat commented on Oct 24, 2026

    @ynohat
    ynohat
    on Oct 24, 2026
    Author
    More actions

    Thanks. I've added our details to #53341: vLLM and LM Studio use the same helper, the failure is silent, and our connect time was about 9s. Happy for this to be closed as a duplicate.

  4. ynohat commented on Oct 24, 2026

    @ynohat
    ynohat
    on Oct 24, 2026
    Author
    More actions

    Following up on my earlier reply: I don't think this is a duplicate of #54011. That PR fixes the Unsupported package symptom for explicitly listed models. It doesn't change the 1-second discovery timeout, so this report's case (a remote endpoint with about 9s connect time, zero models and no log entry) is still open. #53341 covers the same timeout for Ollama. Please keep this open to track the timeout for remote endpoints across providers. If you'd rather merge it into #53341, I'm happy with that.

  5. opencode-agent
    closed this as duplicateon Oct 25, 2026
  6. opencode-agent commented on Oct 25, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 25, 2026 – with OpenCode Agent
    Contributor
    More actions

    Closing this as a duplicate of #53341, since we didn't hear back in the last day. #53341 reports the same hard-coded 1-second discovery timeout in packages/core/src/plugin/provider/local.ts, which causes discovery to fail for slow remote endpoints. Please follow that issue for updates. Your vLLM timings and the request for a WARN or ERROR log when discovery fails would be good to add there. Related: PR #54011 keeps configured models usable when discovery fails. Until there's a fix, your workaround (disable opencode.provider.vllm and list the models explicitly) is the way to go. If your case turns out to be different, reply here and we can reopen.

  7. ynohat commented on Oct 26, 2026

    @ynohat
    ynohat
    on Oct 26, 2026
    Author
    More actions

    This is out of scope for #53341 per #54011 (comment) , meaning the timeout won't be addressed there.
    I suggest this issue be reopened accordingly.

  8. opencodejr
    reopened this on Nov 3, 2026
  9. rekram1-node
    closed this as completedin #63700on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closetriaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.