Skip to content

desktop: supervisor respawns a live local service every ~60s (reason: 'missing'), aborting every tool call #61061

Open

Description

@cheezfish

Summary

The desktop supervisor repeatedly declares its live local background service missing and respawns it every ~60 seconds. Each respawn kills any tool call in flight (Tool execution interrupted), so the session becomes unusable while the app looks healthy. Quitting and reopening the app did not clear it; a full OS reboot did.

Environment

  • opencode version: 2.2.5 (desktop app, bundled CLI 2.2.5-arm64)
  • OS: Darwin 25.2.0 arm64 (macOS, Apple silicon)
  • Terminal: Unavailable: desktop app, not a terminal session
  • Shell: /bin/zsh
  • Install/channel: release build, updater reported Update for version 2.2.5 is not available (latest version: 2.2.5) and state up-to-date
  • Active plugins: 22 local plugins auto-loaded from ~/.config/opencode/plugins/*.ts

Reproduction

Not reproduced on demand; it appeared after ~10 hours of app uptime with a session attached to the local background service.

  1. Work in a desktop session served by the local background service.
  2. The app's main.log begins logging, every ~60 s: starting v2 background service → v2 CLI background service starting { reason: 'missing' } → v2 CLI background service ready { probed: false, url: 'http://127.0.0.1:<port>' }.
  3. Every tool call in the session fails instantly with Tool execution interrupted; each failure arrives with a tool-catalog reload, which alternates between two catalog variants (with and without MCP-server tools).

Expected Behavior

The supervisor should see the healthy running service (it never stops answering; a fresh GET /api/info on its loopback URL returns 401 i.e. alive) and not respawn it. Tool calls should complete.

Actual Behavior

12 respawns in 18 minutes, each killing in-flight tool calls. The service itself was never unhealthy from the outside: no crash, and the process kept listening on its loopback port throughout.

Excerpt from ~/Library/Application Support/ai.opencode.desktop/logs/<launch-timestamp>/main.log (one log directory per app launch; truncated noise removed):

[2026-11-01 13:52:11.381] [info]  (main)  starting v2 background service
[2026-11-01 13:52:17.442] [info]  (main)  v2 CLI background service starting { reason: 'missing' }
[2026-11-01 13:52:22.839] [info]  (main)  v2 CLI background service ready {
  runningVersion: '2.2.5',
  probed: false,
  url: 'http://127.0.0.1:49374',
  hostname: '127.0.0.1',
  port: '49374'
}
[2026-11-01 13:53:15.631] [info]  (main)  starting v2 background service
[2026-11-01 13:53:21.697] [info]  (main)  v2 CLI background service starting { reason: 'missing' }
[2026-11-01 13:53:27.065] [info]  (main)  v2 CLI background service ready {
  runningVersion: '2.2.5',
  probed: false,
  url: 'http://127.0.0.1:49374',
  hostname: '127.0.0.1',
  port: '49374'
}

grep -c "starting v2 background service" on that launch's log: 15 total, 12 of them with reason: 'missing', all between 13:52 and 14:10. grep -o "reason: '[a-z-]*'" yields only 'missing'.

Additional Context

Activity

  1. opencodejr commented on Nov 1, 2026

    @opencodejr

    Thanks for the detailed logs and checks. I can't reproduce this here: it needs the desktop app on macOS running for many hours, and the trigger isn't known yet. My sandbox is Linux-only and has no desktop build.

    From the code, the pattern in your main.log matches one specific path. The desktop reconnects (starting v2 background service, probed: false), and about 6 s later the client gives up after three /api/info probes in a row each go unanswered for 2 s. It then treats the service as gone (reason: 'missing'), stops it and starts a new one, which interrupts any tool call that is running. So the service was probably alive but slow to answer those probes, even though your own outside check got a quick 401. Something was also making the desktop reconnect about every 60 s.

    A maintainer with a Mac will need to look at this. If it happens again, these would help most:

    • Before quitting the app, a copy of ~/.local/share/opencode/log/opencode.log (it is cleared on every start, as you noted).
    • Any event stream disconnected lines in that launch's renderer.log, to show what triggers the reconnect every minute.
    • Whether the service process (opencode-cli serve --service) kept the same PID across the respawns.

    Related issues, most likely first:

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

Metadata

Metadata

Assignees

No one assigned

    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