Skip to content

opecode v2 fails to restart after Ctrl + C #53782

Description

@manoharreddyporeddy

Description

opencode v2 fails to restart, after Ctrl + C.

Plugins

playwright mcp

OpenCode version

2.0.24

Steps to reproduce

  1. Run "opecode2" in cmd
  2. Do some 1 hour work
  3. Press Ctrl + C
  4. "opecode2" now will show " Background services fails to restart"

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. opencode-agent commented on Oct 7, 2026

    @opencode-agent
    Contributor

    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 status right after it fails
    • Whether an opencode.exe process is still running in Task Manager at that point, and whether ending it (or running opencode service restart) lets opencode start again
    • The relevant part of %USERPROFILE%\.local\share\opencode\log\opencode.log around 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:

  2. manoharreddyporeddy commented on Oct 8, 2026

    @manoharreddyporeddy
    Author

    1
    Error text

    C:\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 opencode

    its 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.

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