Steps to Reproduce
- Clone repo, run
cd plugin && npm install && npm run build
- Add path-based entry in
opencode.jsonc pointing to the build:
["/path/to/plugin", { "providers": { "default": { "hosts": [...] } } }]
- Run
OPENCODE_EXPERIMENTAL_WORKSPACES=1 opencode
- Press
/warp — you see "New workspace: SSH Provider" option
- Select it — error appears immediately: "Creating Workspace Failed"
Root Cause (initial)
The resolveProvider function in src/index.ts throws immediately if extra.provider is not set:
if (!workspace.extra || typeof ...provider !== "string") {
throw new Error("Workspace extra.provider must be configured");
}
OpenCode TUI’s workspace creation does not pass extra.provider, so it fails instantly.
After Patching
We added a fallback to the first available provider when extra is empty. After that:
- The plugin proceeds to bootstrap (SCP stub, kill old process, start stub, SSH tunnel)
- But bootstrap itself has bugs (see below)
- After fixing those, bootstrap succeeds (~10s), health check passes, workspace is saved to SQLite DB
- But the TUI still shows "Creating Workspace Failed" (now after 10 seconds timeout) — this is a separate issue
Additional Bugs Found in the Plugin Code
- SCP fails when stub is running — SCP happens before
pkill, so if stub exists, the file is locked
pkill -f kills the SSH session — the command itself contains the pattern it’s searching for
pkill without -f silently fails — Linux truncates process names to 15 chars
- No
python3 fallback — buildRemoteStartCommand uses python2 or python, not python3
- No
start_new_session=True — child process may die when SSH closes
- State not persisted —
RuntimeState is in-memory only; after TUI restart, getTarget fails
- Bootstrap is slow — each step (mkdir, SCP, pkill, start) is a separate SSH connection (~12s)
Tested with OpenCode 1.14.51 and 1.15.7 — same behavior.
Missing npm Package
The opencode-remote-provider npm package does not exist on npmjs.com.
This means the documented package-based installation ("opencode-remote-provider" in config) cannot work.
Only path-based local development loading is possible.
Config Format
Scripts in ./scripts/ only support opencode.json (JSON), not opencode.jsonc (JSON with comments). Had to use OPENCODE_CONFIG env var to point to the config file.
Steps to Reproduce
cd plugin && npm install && npm run buildopencode.jsoncpointing to the build:["/path/to/plugin", { "providers": { "default": { "hosts": [...] } } }]OPENCODE_EXPERIMENTAL_WORKSPACES=1 opencode/warp— you see "New workspace: SSH Provider" optionRoot Cause (initial)
The
resolveProviderfunction insrc/index.tsthrows immediately ifextra.provideris not set:OpenCode TUI’s workspace creation does not pass
extra.provider, so it fails instantly.After Patching
We added a fallback to the first available provider when
extrais empty. After that:Additional Bugs Found in the Plugin Code
pkill, so if stub exists, the file is lockedpkill -fkills the SSH session — the command itself contains the pattern it’s searching forpkillwithout-fsilently fails — Linux truncates process names to 15 charspython3fallback —buildRemoteStartCommandusespython2orpython, notpython3start_new_session=True— child process may die when SSH closesRuntimeStateis in-memory only; after TUI restart,getTargetfailsTested with OpenCode 1.14.51 and 1.15.7 — same behavior.
Missing npm Package
The
opencode-remote-providernpm package does not exist onnpmjs.com.This means the documented package-based installation (
"opencode-remote-provider"in config) cannot work.Only path-based local development loading is possible.
Config Format
Scripts in
./scripts/only supportopencode.json(JSON), notopencode.jsonc(JSON with comments). Had to useOPENCODE_CONFIGenv var to point to the config file.