Skip to content

[Bug] Desktop v1.18.5: UnsupportedContentType error on project reload after update #38789

Closed

Description

@Start-Gao

Description

After upgrading to Desktop v1.18.5, the app shows a notification on startup:

无法重新加载test
UnsupportedContentType

The "test" project is the current workspace directory.

Root Cause

The error UnsupportedContentType originates from the generated client SDK (packages/client/src/generated/client.ts), thrown when the server returns a Content-Type header that is neither application/json nor text/event-stream.

This appears to be related to the dual-server compatibility ("Current" architecture) changes in #38462. The new server protocol detection logic is likely sending a request that gets back an unexpected Content-Type response.

Environment

  • OpenCode Desktop v1.18.5
  • Windows 11
  • Project: D:\Workspace\Demo\test

Steps to Reproduce

  1. Install/upgrade to Desktop v1.18.5
  2. Open the app
  3. The app loads the "test" project and shows the error notification

Workaround

(Needs confirmation)

Screenshots

N/A (terminal error notification)

Additional Context

  • Clearing Desktop cache did not resolve the issue
  • The project directory contains normal files (json, html, mjs, md)

Activity

  1. Start-Gao commented on Jul 25, 2026

    @Start-Gao
    Author
    Image
  2. chenye041208 commented on Jul 25, 2026

    @chenye041208

    Can reproduce this on Windows 10 with v1.18.5.

    Steps I confirmed:

    1. Reset OpenCode (delete AppData/Roaming/ai.opencode.desktop)
    2. Re-open the app — no error at this point
    3. Add any folder as a project (even an empty folder)
    4. Close and re-open the app
    5. UnsupportedContentType error pops up every time

    So this is not project-specific — any workspace triggers it.

    Screenshot attached.

    Image
  3. SherUnlocked-4869 commented on Jul 25, 2026

    @SherUnlocked-4869

    I also encountered the same issue

  4. wujialeHK commented on Jul 25, 2026

    @wujialeHK

    I also encountered this problem. In addition, I closed the old session and the session creation failed when I reopened the new session. Do you have this problem?

  5. pppbfw commented on Jul 25, 2026

    @pppbfw

    Me too, the desktop is terrible.

  6. zhangxyjlu commented on Jul 25, 2026

    @zhangxyjlu

    I also encountered the same issue

  7. satrapu commented on Jul 25, 2026

    @satrapu

    I can reproduce this consistently on a clean Windows machine with a local Ollama setup.

    Environment

    • OS: Windows 11 Pro x64
    • OpenCode Desktop: 1.18.5 (installed via winget)
    • Ollama: 0.32.3
    • GPU: NVIDIA GeForce RTX 5080 (16 GB VRAM)
    • CPU: Intel Core Ultra 7 265F
    • RAM: 32 GB DDR5

    Ollama configuration

    OpenCode is configured to use the local OpenAI-compatible endpoint:

    {
      "$schema": "https://opencode.ai/config.json",
      "enabled_providers": ["ollama"],
      "provider": {
        "ollama": {
          "options": {
            "baseURL": "http://localhost:11434/v1"
          },
          "models": {
            "qwen3-coder:30b": {},
            "devstral:24b": {}
          }
        }
      }
    }

    Models

    • qwen3-coder:30b
    • devstral:24b
    • qwen2.5-coder:14b

    Reproduction

    The issue occurs regardless of the opened workspace:

    • empty folder
    • Git repository (~414 MB, ~4,300 files)

    Steps:

    1. Launch OpenCode Desktop.
    2. Open any folder (empty or existing repository).
    3. Select an Ollama model.
    4. Ask a simple question (even "Hello").

    Expected

    The prompt should immediately be sent to Ollama and inference should start.

    Actual

    OpenCode stays on Thinking for several minutes (or indefinitely).

    During this time:

    • ollama ps shows no running model
    • GPU usage stays essentially idle
    • No request appears to reach Ollama

    Running the exact same prompt directly works immediately:

    ollama run qwen3-coder:30b

    Additional diagnostics

    The local OpenAI-compatible endpoint is working correctly:

    Invoke-WebRequest http://localhost:11434/v1/models

    returns:

    • HTTP 200
    • Content-Type: application/json
    • valid model list

    The problem also reproduces when launching OpenCode via:

    ollama launch opencode

    so it does not appear to be caused by my manual configuration.

    The issue is also reproducible:

    • with an empty workspace
    • in Airplane Mode (no Internet connection)

    Logs

    renderer.log consistently contains:

    Failed to finish bootstrap instance ClientError: UnsupportedContentType
    

    This appears during application startup, before any prompt is sent to Ollama.

    The most important observation is that while OpenCode displays Thinking, ollama ps remains empty, suggesting that the request is never sent to Ollama.

  8. Nicol1B13 commented on Jul 26, 2026

    @Nicol1B13

    I can confirm this regression on Windows 11 with OpenCode Desktop 1.18.5 (v1.18.4 works fine).

    Note: The CLI (terminal) version works without issues. The "Unsupported ContentType" error only pops up in the Desktop GUI on the very 1st session initialization (cold start). Subsequent sessions load normally.

  9. walunt236 commented on Jul 26, 2026

    @walunt236

    太恼火了干净安装进去弹的第一个弹窗就是无法重新加载项目

  10. Kuromi-zyzy commented on Jul 26, 2026

    @Kuromi-zyzy

    I encountered the same issue and did some deeper investigation. Here are additional technical findings:

    Additional Root Cause Details

    The error occurs during the "bootstrap instance" process (logged in renderer.log as "Failed to finish bootstrap instance ClientError: UnsupportedContentType"), which fires once per restored session on app startup.

    I confirmed that the sidecar (Go backend, listens on a random localhost port) returns the SPA HTML page (Content-Type: text/html) for unknown routes, including:

    • GET /events
    • GET /api/events

    Instead of the expected text/event-stream or JSON content type. All standard REST API endpoints (GET /project, GET /project/current, GET /project/{id}) work correctly (HTTP 200 with JSON).

    Impact Pattern

    The toast appears for each previously open session at startup. If you had 3 sessions open when closing the app, you will see 3 toasts on the next launch, each for a different project. The toasts auto-dismiss after a few seconds. Core functionality (chat, code editing, file operations) is unaffected.

    Environment

    • OpenCode Desktop v1.18.5
    • Windows 11
    • Multiple projects affected (observed on opencode workspace and Recruitment and Resume project)
  11. AssabTigleG commented on Jul 26, 2026

    @AssabTigleG
    Image

    SAME HERE:

    • OpenCode Desktop v1.18.5
    • Windows 10 (22H2 - 19045.6466)
    • Multiple Projects
  12. AqueleHaru commented on Jul 26, 2026

    @AqueleHaru

    facing same issue here.

  13. joshbla commented on Jul 26, 2026

    @joshbla

    same issues here. on both mac and windows versions of the desktop app.

  14. opencode-agent commented on Jul 27, 2026

    @opencode-agent
    Contributor

    Fixed in v1.18.6 by #38816, which restores legacy MCP state/resource refreshes for V1 workspaces.

  15. cashee commented on Jul 27, 2026

    @cashee

    +1 — same issue on Windows 11, confirmed root cause is sidecar returning SPA HTML for /api/mcp\ and /api/mcp/resource\ routes. v1.18.4 works fine. Waiting for v1.18.6 fix.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions