Skip to content

VS Code extension fails to start with --port parameter - outputs {} #18714

Closed as not planned

Description

@gslvly

Description

When opening the OpenCode VS Code extension, it runs:

opencode --port 29138

This outputs only {} and the server doesn't start properly.

Steps to Reproduce

  1. Run opencode --port 29138
  2. Observe output: {}

Expected Behavior

The server should start in server mode and listen on the specified port.

Actual Behavior

The TUI tries to start alongside the server, causing a conflict. From the debug logs:

ERROR service=default error=[object Object] tui bootstrap failed
{}

Workaround

Using opencode serve --port 29138 works correctly:

opencode server listening on http://127.0.0.1:29138

Environment

  • OpenCode version: 1.3.0
  • Platform: macOS (darwin)
  • Installed via: npm

Suggestion

When --port is specified, OpenCode should automatically run in server mode (like opencode serve) rather than trying to start the TUI. Alternatively, the VS Code extension should use opencode serve --port {port} instead.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 23, 2026
  2. tlerbao commented on Apr 9, 2026

    @tlerbao

    I'm also able to reproduce this outside the VS Code extension on OpenCode 1.4.1.

    Environment

    • OpenCode version: 1.4.1
    • OS: macOS (darwin)
    • Terminal: Warp
    • Also reproduced inside tmux, but tmux is not the root cause

    Repro

    1. Run opencode
      • Works normally
    2. Run opencode --port 4096
      • Hangs / gets stuck
      • Does not enter the normal TUI
      • No visible error message is shown

    Important detail

    At first I suspected tmux, because I was launching OpenCode through a tmux alias. But after testing directly in Warp, the behavior is the same:

    • opencode ✅ works
    • opencode --port 4096 ❌ hangs

    So this appears to be a more general CLI/TUI issue when --port is provided, not just an extension integration issue.

    If helpful, I can provide additional logs or test a debug build.

  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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