Skip to content

Infinite "Restarting service.." for OC v2 (on Windows) #57864

Closed as not planned
Closed as not planned

Description

@gimlichael

Description

After upgrading to OpenCode v2 i often get "Restarting service.." unable to continue.

I don't know how to proceed except restarting my machine / sign out for a new desktop session.

This is typically happening after a resume from sleep but other than that i have not found a cause of action.

On the positive side - it has been consistent for all v2 releases.

opencode service status:
http://127.0.0.1:45278

opencode api get /api/info:
{"version":"2.1.2","pid":16492,"urls":["http://127.0.0.1:45278"],"paths":{"tmp":"C:\Users\redacted\AppData\Local\Temp\opencode"},"capabilities":{"persistentPty":true}}

Plugins

No response

OpenCode version

2.1.2

Steps to reproduce

No response

Screenshot

Image

Operating System

Windows 11

Terminal

Modern PowerShell

Activity

  1. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    Thanks for reporting this, @gimlichael. The "Restarting service…" screen means the TUI can't reach its background service (opencode serve --service), so we need to know why that service doesn't come back after sleep. Next time it happens, could you send the following before you restart your machine?

    1. Logs: the newest files from %USERPROFILE%\.local\share\opencode\log (press WIN+R and paste that path), covering the time around the resume from sleep. Look for lines like Background service is unresponsive, Event stream stalled or already in use.
    2. Service state: in another PowerShell window, the output of opencode service status. Then tell us whether opencode service restart, or opencode service stop followed by starting opencode again, gets you working without a reboot.
    3. Port state: if it still doesn't recover, the output of Get-Process opencode* and netstat -ano | findstr LISTENING, plus the service port shown by opencode service status. This tells us whether the port is still held after the processes have exited.
    4. Environment: how you installed OpenCode (npm @opencode/cli, installer, etc.), and whether you use a VPN, proxy (HTTP_PROXY/HTTPS_PROXY), or firewall/endpoint security software that might reconnect when the machine wakes.

    You can reply here with the details, or edit the issue. If you edit it, please also leave a short comment saying you've updated it so we know you're done.

    These existing issues might be related, ordered from most to least likely. Please check whether one of them already describes your problem:

  2. gimlichael commented on Oct 21, 2026

    @gimlichael
    Author

    Just confirmed that opencode service restart works as a workaround.

  3. opencode-agent commented on Oct 24, 2026

    @opencode-agent
    Contributor

    We're closing this for now because we haven't heard back with the details we asked for. Without the logs from %USERPROFILE%\.local\share\opencode\log from around the resume from sleep, and the output of opencode service status, we can't tell why the background service doesn't come back, or whether this is the same as #57038, #54181 or #52054.

    If it happens again, please reply here with those details, and say whether opencode service restart or opencode service stop gets you working without a reboot. We can reopen the issue then. Thanks, @gimlichael!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions