server: model catalog fetch times out on slow connections, blocking startup ~21s
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- electron, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 230k
- Forks
- 31.3k
- Merge medio
- 5 h 32 min
- PR fusionados (30 d)
- 453
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anomalyco/opencode
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
anomalyco/opencode#67064 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 82/100
anomalyco/opencode#67009 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
area/web type/feature version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
anomalyco/opencode#67001 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any logPosiblemente ocupada @liwenjie200543 la tomó hace 2 días. Abiertoarea/plugins platform/linux reproduced type/bug version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#66970 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksPosiblemente ocupada @argszero la tomó hace 2 días. Abiertoarea/tui platform/wsl status/repro-simulated type/bug version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
anomalyco/opencode#66773 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de anomalyco/opencode
Issues similares
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
tashfeenahmed/freellmapi#2169 ·
Los mantenedores suelen responder en 1 día
-
via-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
vercel-labs/ui#1563 ·
Los mantenedores suelen responder en 1 día