Repository navigation
Description
Summary
The desktop app always starts (or connects to) the shared background service by spawning its managed CLI with serve --service, ignoring opencode service set disabled true. The service process keeps running after the app is closed, leaving a lingering daemon that the disabled flag was supposed to prevent.
Environment
- opencode version: 2.0.30 (CLI); desktop app 2.0.30 (deb, linux amd64)
- OS: Linux 7.0.0-38-generic x86_64 (Ubuntu)
- Terminal: n/a (desktop app); TERM=xterm-256color, COLORTERM=truecolor
- Shell: /bin/bash
- Install/channel: latest (CLI via
opencode upgrade; desktop viaopencode-desktop-linux-amd64.deb) - Active plugins: opencode-terminal-progress
Reproduction
opencode service set disabled true, then verify:opencode service get disabled→trueopencode service status→ no shared service running
- Launch the OpenCode desktop app.
- It spawns its managed CLI:
~/.config/ai.opencode.desktop/cli/2.0.30-x64/opencode-cli serve --service, andopencode service statusnow returnshttp://127.0.0.1:49374. - Quit the desktop app.
- The
serve --serviceprocess is still alive;opencode service statusstill returns the URL.
Expected Behavior
With disabled: true, the desktop app should not start the shared background service — it should use a private server that exits when the app closes, the same behavior documented for CLI clients (https://opencode.ai/v2/docs/cli, opencode service set disabled true). A desktop-side setting to control the shared service would also work.
Actual Behavior
The desktop app never reads the disabled key of the service config. In the desktop app.asar (2.0.30) the service-start command is unconditional:
command: [<managed cli path>, 'serve', '--service', ...](with an optional --hostname 0.0.0.0 --port 3084 variant). The disabled flag is only honored by CLI commands (TUI/run/api correctly use private servers with it set). Observed on desktop 2.0.6 (AppImage) and 2.0.30 (deb).
Additional Context
- Service config
~/.config/opencode/service.json:{"password": "<redacted>", "disabled": true}. - The spawned process has no env overrides (
XDG_CONFIG_HOMEis the default), so it reads the standard config location. - Registration in
~/.local/state/opencode/service.jsonpoints at the spawned process's pid/url. - Reproducible: consistently.
- Workaround in use: a launcher wrapper that runs
opencode service stopafter the desktop app exits.
Activity
opencode-agent commentedon Oct 15, 2026
Thanks for the detailed report and the clear reproduction steps!
You're asking for the desktop app to respect
opencode service set disabled true(or have its own setting): it would use a private server that exits when the app closes, instead of starting the shared background service and leaving it running.Right now the
disabledflag only applies to CLI commands. The CLI docs describe it as making private servers the default "for CLI commands". The desktop app always connects to, or starts, the shared service. So this is new behaviour for the desktop app rather than a bug, and I've marked it as a feature request for maintainers to consider. Your wrapper that runsopencode service stopafter the app exits is a reasonable workaround for now.Related issues:
service disable/enablecommands for the CLIol-loginov commentedon Oct 15, 2026
feature request is ok.
now I used to launch it with miniwrapper to stop service after close