Skip to content

VS Code extension (sst-dev.opencode 0.0.13) fails on OpenCode v2: Unrecognized flag --port #51512

Description

@xxl4tomxu98

Description

After upgrading the OpenCode CLI from v1 to v2 (opencode v2.0.18), opening OpenCode from the VS Code extension (sst-dev.opencode v0.0.13, latest on the Marketplace as of 2025-12-28) fails immediately with:

ERROR
  Unrecognized flag: --port in command opencode

Root cause

The v2 CLI dropped the --port / --hostname flags that existed in v1 (server binding is now handled through the background service/serve subcommand architecture instead of top-level flags). The VS Code extension's bundled dist/extension.js still constructs its CLI invocation using the v1-style --port <n> flag, which v2's argument parser rejects outright.

Steps to reproduce

  1. Install/upgrade to OpenCode CLI v2 (curl -fsSL https://opencode.ai/v2/install | bash)
  2. Have sst-dev.opencode v0.0.13 installed in VS Code
  3. Open a project in VS Code and launch OpenCode via the extension
  4. Observe the Unrecognized flag: --port error at startup

Expected

The extension should either:

  • Detect the CLI major version and adapt its launch invocation accordingly, or
  • Drop --port and use v2's service/serve connection model (e.g. --server <url> / background service) when talking to a v2 CLI.

Environment

  • OS: macOS (darwin 27.0.0)
  • OpenCode CLI: v2.0.18 (installed via curl installer)
  • Extension: sst-dev.opencode 0.0.13 (VS Code Marketplace, last updated 2025-12-28)

Happy to provide more logs if useful.

Activity

  1. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. xxl4tomxu98 commented on Sep 28, 2026

    @xxl4tomxu98
    Author

    Confirmed duplicate — same root cause as #49085 (sdks/vscode/src/extension.ts still passing --port, which v2's CLI no longer accepts) and #50530. Closing in favor of #49085 which has assignee + more detail. Thanks for triaging.

  3. xxl4tomxu98 commented on Oct 12, 2026

    @xxl4tomxu98
    Author

    I still don't think the issue had been resolved. If you think there is already a solution please paste a link here or explain. @jlongster

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