You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode serve fails immediately with generic 'ServeError' on Windows, no stack trace even at DEBUG level #43110
opencode serve fails immediately on every attempt on Windows 11, with a generic error and zero diagnostic detail:
Warning: OPENCODE_SERVER_PASSWORD is not set; server is unsecured.
Error: Unexpected error
ServeError
opencode (interactive TUI mode) works completely fine on the same machine, same install, same config — this is isolated specifically to serve.
Environment
OS: Windows 11 Home (build 26200)
opencode-ai: reproduced on both 1.18.15 and 1.18.18 (latest at time of filing)
Install: npm install -g opencode-ai
Shell: tested from both Git Bash and PowerShell (Administrator), identical result
Steps to reproduce
opencode serve --port 4096
Fails immediately (well under a second after the config-loading log lines), no port ever binds.
What I've ruled out (extensive isolation testing)
Not port-specific — identical failure on ports 4096, 4097, 4098, 4099, and others. None were pre-bound (confirmed via netstat before each attempt).
Not a plugin issue — identical failure with --pure (no external plugins loaded).
Not a version issue — identical failure on 1.18.15 and 1.18.18.
Not a corrupted install — full clean npm uninstall -g opencode-ai + npm cache clean --force + fresh npm install -g opencode-ai@latest, still fails identically. Confirmed the fresh install works for everything else (opencode --version, opencode run "..." both succeed and return real model output).
Not config-related — identical failure with the two local config files (opencode.json, opencode.jsonc) both temporarily removed entirely (zero custom config).
Not the local MCP entry — identical failure with the mcp block in config disabled.
Not hostname/binding-specific — identical failure with --hostname 127.0.0.1 (default), --hostname 0.0.0.0, and --hostname localhost.
Not verbosity-related — --print-logs --log-level DEBUG and DEBUG=* env var both produce the exact same three-line output, no additional detail.
Expected behavior
opencode serve starts a headless server and binds the given port, same as it presumably does on other platforms / for other users, enabling API-based integrations (e.g. opencode-telegram-bot, which requires opencode serve to function and is currently completely blocked by this).
Actual behavior
Immediate failure with a generic wrapped error, no stack trace, no indication of what actually threw.
Additional context
Given the error is a clean, immediate return (not a hang or timeout), this looks like an exception being thrown and caught by the CLI's own generic error handler during server construction, with the real underlying error swallowed rather than surfaced. Happy to run additional diagnostics or a debug build if that would help narrow it down further — I've exhausted what's reachable from the public CLI surface.
#38738 in particular describes the identical symptom (bare ServeError with no underlying errno surfaced) and includes a detailed root-cause analysis. The Windows-specific failure you're seeing may be a distinct platform issue on top of that, but it's worth reviewing before proceeding.
Activity
github-actions commentedon Aug 17, 2026
This issue might be a duplicate of existing issues. Please check:
ServeError/ "Unexpected error" output with no diagnostic detail — root cause analysis and proposed fix includedopencode web/serveon Windows failing to accept connectionsopencode serveon Windows crashing with control signal issues#38738 in particular describes the identical symptom (bare
ServeErrorwith no underlying errno surfaced) and includes a detailed root-cause analysis. The Windows-specific failure you're seeing may be a distinct platform issue on top of that, but it's worth reviewing before proceeding.github-actions commentedon Oct 17, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.