Skip to content

# Desktop: "Could not reach Local Server" when the protocol probe times out (TypeError reading 'temperature') #51587

Closed as not planned

Description

@TheJack415

Description

Summary

On some launches, Desktop shows "Could not reach Local Server / Retrying automatically..." and never recovers. The sidecar is healthy: main.log shows server ready. The renderer crashes during bootstrap:

[global-sdk] event stream failed [object Object]
Failed to finish bootstrap instance TypeError: Cannot read properties of undefined (reading 'temperature')

Pressing Ctrl+R about 30 seconds later always fixes it. Clicking "Other servers" > "Local Server" also fixes it.

Root cause (from the bundled renderer, out/renderer/assets/main-*.js)

  1. detectServerProtocol() probes /global/health with AbortSignal.timeout(5000). If that probe fails or times out, and /api/health gives no answer either, the function falls through to return "v2".
  2. On my machine the sidecar is unresponsive for roughly 20 seconds after server ready. So on some launches the probe times out and a v1 server is treated as v2.
  3. loadAgentsQuery then takes the v2 path. The agents come back in the AgentV2 shape, whose request object contains only { headers, body }. Provider.Request has no settings.
  4. normalizeAgentList() then does:
    temperature: typeof agent.request.settings.temperature === "number" ? ... : void 0,
    topP:        typeof agent.request.settings.topP === "number" ? ... : void 0,
    agent.request.settings is undefined, so this throws.
  5. The detected protocol is cached for the connection, so "Retrying automatically" never re-probes. Only a reload or reconnect recovers.

Steps to reproduce

  1. Launch Desktop on a machine where the sidecar takes more than 5 seconds to become responsive after spawn. Mine has about 30 skills in ~/.config/opencode/skills and a OneDrive-synced project folder.
  2. Observe the "Could not reach Local Server" screen and the TypeError in logs/<ts>/renderer.log.
  3. Press Ctrl+R after the server has warmed up. The app loads normally.

Suggested fixes

  • Guard the read, e.g. agent.request?.settings?.temperature and agent.request?.settings?.topP.
  • Don't default to "v2" when both health probes fail or time out. Retry the probe, or re-detect it on each reconnect attempt, instead of caching the fallback.
  • Optionally, give the first probe after sidecar spawn a longer timeout.

Environment

  • Windows 11 Enterprise 10.0.26100, x64
  • Desktop 1.18.31 (1.18.32 pending; I checked its renderer and it has the same normalizeAgentList and detectServerProtocol code)
  • Custom providers configured via @ai-sdk/openai-compatible and @ai-sdk/anthropic behind a corporate gateway. I don't think this is relevant: the crash is in agent normalization, not provider loading.

Plugins

No response

OpenCode version

Version: OpenCode Desktop 1.18.31, Windows 11 x64 (same code is also in 1.18.32)

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    For keybind-related issues, please also check our pinned keybinds documentation: #4997

  2. neriousy commented on Oct 19, 2026

    @neriousy
    Member

    V2 no longer uses the v1/v2 protocol probe or caches a guessed protocol after its health checks time out. The desktop app uses the native v2 client connection with managed reconnection, removing the v1-sidecar misclassification path described here. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.

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