OpenCode Beta (opencode-v2) extension is broken: published VSIX ships without dist/extension.js, and the sidebar view never renders
Summary
The OpenCode Beta extension (sst-dev.opencode-v2, v0.1.1) is broken out of the box. The published VSIX does not include the compiled dist/extension.js that package.json declares as "main". As a result the extension can never activate, and the activity-bar icon / sidebar view does nothing.
I diagnosed and fixed this locally (by hand-patching the installed bundle), and I'm filing this issue so the source can be fixed properly and the next release ships a working extension.
Root causes found
1. The VSIX is missing dist/extension.js entirely
The installed extension directory contains only:
package.json
readme.md
images/
.vsixmanifest
There is no dist/ directory and no node_modules. The .vsixmanifest <Assets> only lists package.json, readme.md, and icon.png — the compiled bundle was never included in the package. Since package.json declares "main": "./dist/extension.js", VS Code cannot load the extension at all.
2. The sidebar view is missing "type": "webview"
The opencode-v2.panel view is declared without "type": "webview":
"views": {
"opencode-v2": [
{ "id": "opencode-v2.panel", "name": "OpenCode", "when": "true" }
]
}
Without "type": "webview", VS Code treats the view as a plain tree view and never invokes the WebviewViewProvider. Compare with the working tanishqkancharla.opencode-vscode and saoudrizwan.claude-dev extensions, which both declare "type": "webview" on their webview views. The fix is:
"views": {
"opencode-v2": [
{ "type": "webview", "id": "opencode-v2.panel", "name": "OpenCode", "when": "true" }
]
}
3. Missing onView activation event
activationEvents only lists the two commands. Clicking the activity-bar icon fires onView:opencode-v2.panel, which is not declared, so the extension may not activate when the view is opened. Add:
"activationEvents": [
"onCommand:opencode-v2.openPanel",
"onCommand:opencode-v2.refreshPanel",
"onView:opencode-v2.panel"
]
4. Windows: spawning the npm-installed CLI fails
On Windows, opencode installed via npm lands as a .cmd shim (e.g. C:\Users\<user>\AppData\Roaming\npm\opencode.cmd). Spawning a .cmd/.bat file directly with child_process.spawn() fails with ENOENT. It must be launched through cmd.exe /c (via process.env.ComSpec).
5. Avoid blocking calls during activation
The extension host became unresponsive (logged Extension host is unresponsive) when activation used blocking calls like execSync("npm root -g") and synchronous fs.existsSync PATH scanning. All CLI discovery and server startup should be asynchronous.
Suggested source-level fixes
- Ensure the build/package step actually emits and includes
dist/extension.js in the VSIX (check esbuild.js output and .vscodeignore).
- Add
"type": "webview" to the opencode-v2.panel view contribution.
- Add
"onView:opencode-v2.panel" to activationEvents.
- Use
cmd.exe /c (via ComSpec) when spawning .cmd/.bat CLI shims on Windows.
- Keep activation non-blocking (no
execSync, no sync fs.existsSync loops).
Environment
- VS Code: latest stable
- OS: Windows 11
- Extension:
sst-dev.opencode-v2 v0.1.1
opencode CLI: v1.18.14 (installed via npm at C:\Users\<user>\AppData\Roaming\npm\opencode)
Note
The opencode-v2 source does not appear to be present in this repository — only the older terminal-based sdks/vscode extension is in the tree (checked main and 2.0 branches). Please confirm where the opencode-v2 source lives so it can be fixed and republished.
OpenCode Beta (opencode-v2) extension is broken: published VSIX ships without
dist/extension.js, and the sidebar view never rendersSummary
The OpenCode Beta extension (
sst-dev.opencode-v2, v0.1.1) is broken out of the box. The published VSIX does not include the compileddist/extension.jsthatpackage.jsondeclares as"main". As a result the extension can never activate, and the activity-bar icon / sidebar view does nothing.I diagnosed and fixed this locally (by hand-patching the installed bundle), and I'm filing this issue so the source can be fixed properly and the next release ships a working extension.
Root causes found
1. The VSIX is missing
dist/extension.jsentirelyThe installed extension directory contains only:
package.jsonreadme.mdimages/.vsixmanifestThere is no
dist/directory and nonode_modules. The.vsixmanifest<Assets>only listspackage.json,readme.md, andicon.png— the compiled bundle was never included in the package. Sincepackage.jsondeclares"main": "./dist/extension.js", VS Code cannot load the extension at all.2. The sidebar view is missing
"type": "webview"The
opencode-v2.panelview is declared without"type": "webview":Without
"type": "webview", VS Code treats the view as a plain tree view and never invokes theWebviewViewProvider. Compare with the workingtanishqkancharla.opencode-vscodeandsaoudrizwan.claude-devextensions, which both declare"type": "webview"on their webview views. The fix is:3. Missing
onViewactivation eventactivationEventsonly lists the two commands. Clicking the activity-bar icon firesonView:opencode-v2.panel, which is not declared, so the extension may not activate when the view is opened. Add:4. Windows: spawning the npm-installed CLI fails
On Windows,
opencodeinstalled via npm lands as a.cmdshim (e.g.C:\Users\<user>\AppData\Roaming\npm\opencode.cmd). Spawning a.cmd/.batfile directly withchild_process.spawn()fails withENOENT. It must be launched throughcmd.exe /c(viaprocess.env.ComSpec).5. Avoid blocking calls during activation
The extension host became unresponsive (logged
Extension host is unresponsive) when activation used blocking calls likeexecSync("npm root -g")and synchronousfs.existsSyncPATH scanning. All CLI discovery and server startup should be asynchronous.Suggested source-level fixes
dist/extension.jsin the VSIX (checkesbuild.jsoutput and.vscodeignore)."type": "webview"to theopencode-v2.panelview contribution."onView:opencode-v2.panel"toactivationEvents.cmd.exe /c(viaComSpec) when spawning.cmd/.batCLI shims on Windows.execSync, no syncfs.existsSyncloops).Environment
sst-dev.opencode-v2v0.1.1opencodeCLI: v1.18.14 (installed via npm atC:\Users\<user>\AppData\Roaming\npm\opencode)Note
The
opencode-v2source does not appear to be present in this repository — only the older terminal-basedsdks/vscodeextension is in the tree (checkedmainand2.0branches). Please confirm where theopencode-v2source lives so it can be fixed and republished.