server: model catalog fetch times out on slow connections, blocking startup ~21s
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- electron, typescript
調査の方向性
Start with the server startup path exercised by opencode serve --service, then locate the model catalog request to the documented models.opencode.ai endpoint and inspect ~/.local/share/opencode/log/opencode.log. There are no file or test names in the issue, so find the existing fetch, timeout, configuration, and cache-related tests before changing behavior. Done means a slow catalog response can succeed or use cached data, and a failed refresh does not delay startup by the fetch timeout.
索引モデルが issue の本文から書いたものです。
説明
Summary
On startup, OpenCode fetches the model catalog from https://models.opencode.ai/experimental/v2.0/api.json?type=chat,decision,image with a hardcoded ~10s timeout. On slow connections the response is ~11.6 MB and takes 16-27s, so the fetch always fails and startup is blocked for ~21s on every launch.
Environment
- opencode version: v2.2.7
- OS: Windows 10 22H2 (Microsoft Windows NT 10.0.19045.0), x64
- Terminal: Desktop app (Electron + WebView2) - no terminal
- Shell: C:\Windows\system32\cmd.exe
- Install/channel: latest - desktop app
ai.opencode.desktop, bundled CLI2.2.7-x64 - Active plugins: none
Reproduction
- Use a connection where
models.opencode.aidownloads at ~450 KB/s. - Start OpenCode (desktop app, or
opencode serve --service). - Watch
~/.local/share/opencode/log/opencode.logforrole=server.
Expected Behavior
The catalog fetch either succeeds, is cached across launches, or is not on the critical startup path. A failed catalog fetch should not add ~20s to startup.
Actual Behavior
level=ERROR message="Failed to fetch models.dev"
cause="Cause([Fail(TimeoutError: Operation timed out after '10s')])"
The fetch is retried and startup is blocked for ~21s before MCP servers begin connecting.
Measured from this machine with the same URL:
| attempt | size | time |
|---|---|---|
| 1 | 11,641 KB | 23.3s |
| 2 | 11,641 KB | 27.3s |
| 3 | 11,641 KB | 15.8s |
The same URL fetched with Invoke-WebRequest and a 60s timeout returns HTTP 200 every time, so the endpoint is healthy - only the 10s client timeout is too short.
Additional Context
Startup timeline for a single run (from the log):
07:30:56 cli starting
07:30:57 location services booted (1.1s)
07:31:19 Failed to fetch models.dev (+22s)
07:31:47 mcp connected (+26s)
Failed to fetch models.dev appears 104 times in the log. Earlier occurrences also show transient DNS failures:
Transport error (GET https://models.opencode.ai/experimental/v2.0/api.json?type=chat,decision,image)
(cause: TypeError: getaddrinfo ENOTFOUND models.opencode.ai)
DNS resolves correctly now (Cloudflare 104.18.10.66 / 104.18.11.66), so the remaining failure is purely the timeout.
Requested fix: make the catalog timeout configurable (or raise it), and/or cache the last successful catalog so a failed refresh does not block startup.
Workaround tried: none available - no documented config field controls this timeout.
- 主要言語
- TypeScript
- スター
- 230k
- フォーク
- 31.3k
- 平均マージ
- 5時間 32分
- マージ済み PR(30日)
- 453
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
anomalyco/opencode#67064 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 82/100
anomalyco/opencode#67009 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/web type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
anomalyco/opencode#67001 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log対応中かも @liwenjie200543 が 2 日前に担当しました。 オープンarea/plugins platform/linux reproduced type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#66970 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks対応中かも @argszero が 2 日前に担当しました。 オープンarea/tui platform/wsl status/repro-simulated type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
anomalyco/opencode#66773 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
tashfeenahmed/freellmapi#2169 ·
メンテナーはふだん 1 日以内に返信
-
via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vercel-labs/ui#1563 ·
メンテナーはふだん 1 日以内に返信