Skip to content

Bug2 #61477

Closed as not planned
Closed as not planned

Description

@vana30421-cpu

Description

This is the second time I have encountered a critical bug in OpenCode Desktop 2.2.5 on Windows 11. The models.dev fetch lock hangs for the full 10-second timeout, blocking /api/model and /api/provider, and returning persistent 503 errors.

I have already applied the workaround (OPENCODE_DISABLE_MODELS_FETCH=1) and manually fixed my local setup. However, this is the second occurrence, and it has already caused my company's workflow to be halted. Time was lost, and operations were interrupted.

I am currently on the Free Tier (no payment made), so I am not asking for a cash refund. Instead, I am requesting compensation in the form of extended quota or a period of premium access to make up for the lost business time caused by your broken software. This is not a trivial bug—it is a repeat failure that directly impacts paying customers and free users who rely on your tool for production work.

I expect a concrete compensation offer, not just a "duplicate" label. Please escalate this to the team responsible for user compensation.

My logs and issue history are attached. I am available for further details if needed.

Plugins

No response

OpenCode version

2.2.5

Steps to reproduce

No response

Screenshot

No response

Operating System

No response

Terminal

No response

Activity

  1. opencodejr commented on Nov 3, 2026

    @opencodejr
    Contributor

    Thanks for the report, and sorry this has disrupted your work again.

    I think this is a duplicate of #61118, and it repeats your earlier report #61476. Possible duplicates and closely related issues, ordered by likelihood:

    The issue mentions attached logs, but none came through. If you have the full server log or the body of one of the 503 responses, please add them to #61118. That helps more than opening new issues.

    About compensation: GitHub issues don't handle account requests like extended quota or premium access. Please email [email protected] with the details, and keep account information out of this public issue.

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

  2. vana30421-cpu commented on Nov 3, 2026

    @vana30421-cpu
    Author

    How my issue is differe

    message.txt

    m the standard #61118 scenario:

    1. Cache fallback does not work. The bot states it cannot reproduce the bug because "the server serves the cached or bundled model catalog without waiting on that lock." However, in my case (Desktop 2.2.5, Windows 11), the server does not serve the cache. It hits the 10-second lock and blocks foreground requests, returning persistent 503 for /api/model, /api/provider, and /api/agent. I have attached my full server log proving this continuous 503 behavior.
    2. Workaround failed. I applied OPENCODE_DISABLE_MODELS_FETCH=1 and restarted the system. It did not fix the issue. The lock is still being held, and models remain unavailable.
    3. Not the plugin issue (Desktop: fatal "Location plugins did not finish activating" when the OpenAI login refresh at startup takes over 5 seconds #61443). My 503 response is a generic Service Unavailable. It does not contain the text "Location plugins did not finish activating".
    4. Extensive troubleshooting. To try and fix this, I have completely reinstalled the application about 7 times from scratch, including full cache and config wipes. The fact that a clean install still results in this lock proves the fallback logic is fundamentally broken in my environment.

    Since this is the second time this has happened and it has completely halted my company's workflow, I need a concrete solution (a patch or a confirmed downgrade version) and a response regarding compensation.

    (Log file message.txt attached below)

    message.txt

  3. opencodejr commented on Nov 3, 2026

    @opencodejr
    Contributor

    Thanks for the log. It showed this isn't the models.dev lock from #61118. Your log has no models.dev fetch at all, and every 503 takes exactly 5 seconds. That is the server's limit for waiting on plugins to start. The response is Location plugins did not finish activating.

    I reproduced it on 2.2.5 with opencode serve and a config containing only "plugin": ["opencode-token-tracker@latest"]. I also slowed down access to the npm registry to imitate a slow network. While the plugin was downloading, /api/provider, /api/model and /api/agent all returned 503 after 5 seconds, every time, and the built-in providers weren't available either. With a normal connection the download takes a few seconds and things recover. A slow or filtered connection to npm keeps everything at 503 for as long as the download takes. In your log the plugin only loaded about 140 seconds after startup, from a newly downloaded copy. That would explain why reinstalling and wiping the cache didn't help: each clean install downloads the plugin again. The same thing still happens on the latest dev (156bb61). The script below reproduces it.

    Until this is fixed, removing opencode-token-tracker@latest from the plugin list in your config should let models load. Pinning a version, or making sure npm can be reached quickly, may help too. One thing I couldn't reproduce: your log shows 503s continuing after the plugin had loaded. If they keep happening with the plugin removed, please say so here.

    Related: #61443 (the same 5-second plugin wait, caused by an OpenAI login refresh) and #57011 (a proposed change to keep serving models while plugins reload).

    Reproduction script (repro.sh)
    #!/usr/bin/env bash
    # Repro for #61477: start `opencode serve` with the npm plugin opencode-token-tracker@latest
    # and poll the plugin-gated endpoints.
    set -u
    OPENCODE=${OPENCODE:-opencode}
    T=${T:-$(mktemp -d /tmp/opencode/r61477.XXXX)}
    export HOME=$T/home XDG_CONFIG_HOME=$T/home/.config XDG_DATA_HOME=$T/home/.local/share XDG_CACHE_HOME=$T/home/.cache XDG_STATE_HOME=$T/home/.local/state
    mkdir -p $XDG_CONFIG_HOME/opencode $T/proj
    echo '{"plugin":["opencode-token-tracker@latest"]}' > $XDG_CONFIG_HOME/opencode/opencode.json
    # Simulate a slow npm registry (slow/filtered network): every request is delayed by $DELAY ms
    if [ -n "${DELAY:-}" ]; then
      echo "registry=http://127.0.0.1:4873/" > $HOME/.npmrc
      export NPM_CONFIG_REGISTRY=http://127.0.0.1:4873/ BUN_CONFIG_REGISTRY=http://127.0.0.1:4873/
      DELAY=$DELAY node "$(dirname "$0")/slow-registry.mjs" > $T/registry.log 2>&1 &
      RPID=$!
    fi
    cd $T/proj
    PORT=${PORT:-4977}
    OPENCODE_PASSWORD=pw $OPENCODE serve --port $PORT --print-logs --log-level info > $T/server.log 2>&1 &
    PID=$!
    sleep 3
    for i in $(seq 1 ${ROUNDS:-12}); do
      for ep in provider model agent; do
        code=$(curl -s -u opencode:pw -o $T/body -w '%{http_code} %{time_total}s' "http://127.0.0.1:$PORT/api/$ep?location%5Bdirectory%5D=$T/proj")
        echo "$(date -u +%T) /api/$ep $code $(head -c 160 $T/body)"
      done
    done
    kill $PID; [ -n "${RPID:-}" ] && kill $RPID
    echo '--- registry log'; cat $T/registry.log 2>/dev/null
    echo "--- server log (plugin / models.dev lines)"
    grep -Ei 'plugin|models.dev|error' $T/server.log | head -40

    Run it: bash repro.sh

  4. marked Bug #61476 as a duplicate of this issue on Nov 4, 2026
  5. marked bug2 #61479 as a duplicate of this issue on Nov 4, 2026
  6. neriousy commented on Nov 12, 2026

    @neriousy
    Member

    Sorry about the disruption. We don't offer compensation or quota credits for bugs. The models.dev fetch hang itself is tracked separately, and OPENCODE_DISABLE_MODELS_FETCH=1 is the workaround until that lands. Closing this one.

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