Repository navigation
opecode v2 fails to restart after Ctrl + C #53782
Description
Activity
Thanks for the report! I tried this on Linux with v2.0.24: I started
opencode, quit with Ctrl+C and started it again several times, and the background service came back each time. So this looks specific to Windows, where Ctrl+C is delivered to processes differently. It needs a maintainer with a Windows machine to reproduce it.In the meantime, these would help:
- The exact error text from the screenshot, pasted as text
- The output of
opencode service statusright after it fails - Whether an
opencode.exeprocess is still running in Task Manager at that point, and whether ending it (or runningopencode service restart) letsopencodestart again - The relevant part of
%USERPROFILE%\.local\share\opencode\log\opencode.logaround the failure (please remove API keys and other sensitive data) - Whether it also happens after only a short session, or only after a long one
Related issues, ordered by likelihood:
- [Bug]: opencode serve on Windows crashes with STATUS_CONTROL_C_EXIT when attached TUI sends session_interrupt or app_exit #41878: on Windows, Ctrl+C from an attached TUI kills
opencode servewithSTATUS_CONTROL_C_EXIT, and the leftover socket then blocks restarts - [v2 Windows] v2.0.3 times out waiting for background service after local CLI install #49034 / [v2 Windows] opencode2 hangs at "Starting background server..." after reinstall #41746: on Windows,
opencode2times out waiting for the background service to start - service (v2): restart spawns serve --service in a silent retry loop, forcing manual process kill #37239: restarting the service gets stuck in a silent retry loop of
serve --service - cli: service discovery intermittently times out waiting for the background service #52021: on Windows, finding the running background service sometimes times out
1
Error textC:\code\copilot-worktrees>opencode2 Error: Background service failed to start at <anonymous> (B:/~BUN/root/chunk-c0q6gxje.js:3:6220) at service.ensure (B:/~BUN/root/chunk-ntjmkcr5.js:3:690) at service.ensure (definition) (B:/~BUN/root/chunk-c0q6gxje.js:3:5105) at cli.server-connection.resolve (B:/~BUN/root/chunk-33r0xqka.js:96:6565) at cli.server-connection.resolve (definition) (B:/~BUN/root/chunk-ntjmkcr5.js:2:402)2
<I don't have output of opencode service status right after it fails>3
I am using opencode2, not opencodeits at
C:\Program Files\nodejs\opencode2
C:\Program Files\nodejs\opencode2.cmd- opecode2 process was running in Task Manager at that point
4
Relevant part of %USERPROFILE%.local\share\opencode\log\opencode.log
timestamp=2026-10-07T08:07:37.965Z level=INFO run=58203fe4 message="cli starting" version=2.0.24 channel=latest local=false args=[] role=cli timestamp=2026-10-07T08:07:38.079Z level=INFO run=58203fe4 message="background service starting" reason=version-mismatch previousVersion=2.0.19 role=cli timestamp=2026-10-07T08:07:38.329Z level=INFO run=67d9111f message="cli starting" version=2.0.24 channel=latest local=false args="[\"serve\",\"--service\"]" role=cli timestamp=2026-10-07T08:07:38.786Z level=ERROR run=67d9111f message="background service boot failed" cause="Cause([Die(SQLiteError: disk I/O error)])" role=server timestamp=2026-10-07T08:07:38.795Z level=INFO run=67d9111f message="Sent HTTP response" http.span=1 role=server http.method=GET http.url=/api/info http.status=500 timestamp=2026-10-07T08:07:39.497Z level=ERROR run=58203fe4 message="cli process failed" cause="Cause([Fail(Error: Background service failed to start)])" args=[] role=cli timestamp=2026-10-07T08:07:41.578Z level=INFO run=c8951d64 message="cli starting" version=2.0.24 channel=latest local=false args=[] role=cli timestamp=2026-10-07T08:07:41.659Z level=ERROR run=c8951d64 message="cli process failed" cause="Cause([Fail(Error: Background service failed to start)])" args=[] role=cli timestamp=2026-10-07T08:07:41.658Z level=INFO run=67d9111f message="Sent HTTP response" http.span=1 role=server http.method=GET http.url=/api/info http.status=500 timestamp=2026-10-07T08:27:41.984Z level=INFO run=7dd4ae53 message="cli starting" version=2.0.24 channel=latest local=false args=[] role=cli timestamp=2026-10-07T08:27:47.056Z level=INFO run=7dd4ae53 message="background service starting" reason=missing previousVersion=undefined role=cli timestamp=2026-10-07T08:27:47.449Z level=INFO run=7dd4ae53 message="spawning process" command=npm args="[\"list\",\"-g\",\"--depth=0\",\"@opencode/cli\"]" cwd=undefined role=cli timestamp=2026-10-07T08:27:47.480Z level=INFO run=7dd4ae53 message="spawning process" command=pnpm args="[\"list\",\"-g\",\"--depth=0\",\"@opencode/cli\"]" cwd=undefined role=cli timestamp=2026-10-07T08:27:47.510Z level=INFO run=7dd4ae53 message="spawning process" command=bun args="[\"pm\",\"ls\",\"-g\"]" cwd=undefined role=cli timestamp=2026-10-07T08:27:47.556Z level=INFO run=7dd4ae53 message="spawning process" command=yarn args="[\"global\",\"list\"]" cwd=undefined role=cli timestamp=2026-10-07T08:27:47.578Z level=INFO run=7dd4ae53 message="spawning process" command=vp args="[\"list\",\"-g\",\"--json\",\"@opencode/cli\"]" cwd=undefined role=cli timestamp=2026-10-07T08:27:47.166Z level=INFO run=23f3421f message="cli starting" version=2.0.24 channel=latest local=false args="[\"serve\",\"--service\"]" role=cli timestamp=2026-10-07T08:27:47.685Z level=INFO run=23f3421f message="spawning process" command="C:\\Program Files\\Git\\cmd\\git.EXE" args="[\"rev-parse\",\"--git-dir\",\"--git-common-dir\",\"--show-toplevel\"]" cwd="C:\\code\\copilot-worktrees\\repo1\\repo1" http.span=10 role=server timestamp=2026-10-07T08:27:47.804Z level=INFO run=23f3421f message="spawning process" command="C:\\Program Files\\Git\\cmd\\git.EXE" args="[\"remote\",\"get-url\",\"origin\"]" cwd="C:\\code\\copilot-worktrees\\repo1\\repo1" http.span=129 role=server timestamp=2026-10-07T08:27:47.934Z level=INFO run=23f3421f message="watcher subscribe" path="C:\\Users\\user1\\.config\\opencode" type=directory ignores=3 http.span=259 role=server
5
Happened after a 1hr+ minute session, although model might be idle most of the time due to inactivity.
Description
opencode v2 fails to restart, after Ctrl + C.
Plugins
playwright mcp
OpenCode version
2.0.24
Steps to reproduce
Screenshot and/or share link
Operating System
Windows 11
Terminal
Windows Terminal