Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>OpenCode Session HubNew to Visual Studio Code? Get it now.
OpenCode Session Hub

OpenCode Session Hub

Parker Qiu

|
1 install
| (0) | Free
OpenCode sessions in the sidebar, conversations in a dedicated editor tab.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

OpenCode Session Hub (preview)

A session navigator and dedicated conversation editor for the existing OpenCode V2.2.x background service. This is an independent preview extension, not the official SST terminal extension.

Features

  • Chat with streamed Markdown, reasoning and tool cards.
  • Lifecycle markers such as idle are not chat messages. The conversation header shows Idle / Working… (or connection status) separately; real failures remain visible.
  • Left sidebar lists/searches sessions only. Selecting or creating a session opens a separate conversation editor tab, instead of putting the chat inside the sidebar.
  • Create and restore sessions for the selected workspace directory; load older messages.
  • Conversations use a single-line title with ellipsis and full-title tooltip; no second date line.
  • Only the selected conversation shows the original right-side action icon. Selecting a row opens the chat but does not expand controls; click the icon to toggle Delete / Archive / Cancel. Delete is the first/default primary action and permanently removes the session through OpenCode's API. Archive hides it while retaining messages. Cancel hides the controls; click the icon again to reopen them. No mutation happens by selecting a row or opening the menu.
  • The old explanatory paragraph and native confirmation popup are removed. Delete's tooltip identifies it as permanent. Running sessions must be stopped or finished first; workspace/activity checks are repeated before mutation.
  • During requests, Deleting… / Archiving… and retryable errors are shown inline. Removal uses a per-session guard, not the global chat-request lock. Delete does not undo file changes and is not a guarantee of secure erasure of snapshots/logs/backups.
  • The Workspace: name label below New conversation identifies the current directory; hover to see its full path.
  • Select models, model variants and primary agents.
  • Add the current file or selection, including unsaved editor content.
  • Approve or reject tool requests; answer basic forms in VS Code dialogs.
  • Stop execution; reconnect and recover backend history without resending messages.
  • Open Markdown file links with line numbers.

Models, MCP servers, Skills, instructions and tools remain owned by OpenCode. The extension does not copy their configuration or credentials.

Install in Remote SSH

  1. Connect VS Code to your Linux development machine with Remote SSH.
  2. Open the directory whose OpenCode sessions you want to use. To see an existing terminal session, open its exact working directory.
  3. In Extensions, select Install from VSIX… and choose opencode-session-hub-0.1.0.vsix. Ensure the extension is installed/enabled on the SSH host. Minimum VS Code version: 1.99.0.
  4. Ensure OpenCode is running on the remote host. If needed, start /data/i518942/.opencode/bin/opencode in a remote terminal.
  5. Trust the workspace, then click the OpenCode Activity Bar icon. Click a conversation card or New conversation to open the chat in the editor area. One reusable conversation tab is used; selecting another card switches that tab's session.

The extension runs on the workspace host. It discovers the existing local service and uses its authentication. The preview is discovery-only: it never starts, stops or restarts a service. If no healthy service is found, start OpenCode yourself in a remote terminal, then click Reconnect. This avoids the SDK's automatic recovery terminating an existing unresponsive service.

If connection loading stalls, run OpenCode: Show Connection Log or open Output → OpenCode Sidebar. Diagnostics show discovery, service health, catalog loading and event-stream readiness, without credentials or message content. Requests use a loopback-only Node HTTP transport, not VS Code's global fetch/proxy bridge. REST requests and initial event handshakes have timeouts; unavailable live updates produce an error instead of indefinite Connecting.

REST and event subscriptions now run in a dedicated API worker, not the shared extension-host event loop. The worker uses an explicit allowlist of the extension's API operations and a pull-based event bridge. Network deadlines run in the worker; ordinary RPC replies have a host-side safety deadline, while idle event reads do not expire. Errors report the operation plus safe status/transport codes, including safe nested SDK causes. Request arguments, headers, response bodies and credentials are not logged. The worker does not automatically retry mutations.

Saving the selected session in VS Code workspace storage is best-effort and nonblocking. A stalled storage write or failed saved-history restoration does not disconnect the OpenCode service.

Service discovery runs in an independent worker so its health probe is not stalled by other extensions sharing the main event loop. Discovery allows 30 seconds and logs worker-to-host delivery lag. This does not fix an overloaded or out-of-memory VS Code host: if CPU/memory remain high, use Developer: Show Running Extensions to profile the host, or test a temporary profile with only this extension enabled (and Remote SSH on the local side). No other extensions or VS Code settings are modified automatically.

Send with Enter; use Shift+Enter for a newline. Select code and use OpenCode: Add Selection to Chat, or the editor context menu. The composer also remembers the last active text editor when focus moves to the conversation tab. Captured context is attached to the next prompt; it is not transmitted merely by opening a file. Context is plain editor text with path/line metadata, not a grant of additional filesystem permissions. Closing the conversation editor does not stop backend execution; click its session card to reopen it. In-tab drafts are isolated per session while the Webview remains alive; closing the tab may discard unsent drafts.

Restore an archived conversation

Archiving is reversible. This preview does not yet have an archived-session browser. Use OpenCode's API from a terminal to list archived sessions and restore the desired ID:

opencode api get '/api/session?archived=true&limit=20'
opencode api patch /api/session/SESSION_ID --data '{"archived":false}'

The Recent conversations list refreshes when the service emits the unarchive event.

Develop

Requires Node.js 22+, npm and OpenCode V2.2.x.

The packaged extension targets Node 20.18 (VS Code 1.99's extension host); development/packaging tools require Node 22+. The SDK's Promise.withResolvers calls are replaced at build time without modifying global objects.

npm ci
npm run typecheck
npm run build
npm test
npm run verify:backend
npm run verify:host
npm run package

verify:backend creates and removes its own disposable test session. It checks prompt admission, approvals and forms without calling a model. npm run verify:backend -- --live additionally makes one small model request with all tools denied.

Open this project in VS Code and press F5 to launch the extension development host. Tests include timeline/protocol unit tests and bundled Webview DOM tests; they do not replace a real VS Code/Remote SSH UI test.

Preview limitations

  • Built against client/server 2.2.5; other 2.2.x versions still require testing. API compatibility is not assumed for other release lines.
  • Session picker shows the newest 50 unarchived root sessions in the exact directory; history loads 100 messages per page.
  • One selected session per sidebar; no automatic merging with a terminal's selected session. Both clients can view a saved session, but avoid concurrent control. Busy-state checks reduce accidental overlap, not a cross-client locking guarantee.
  • Child-session approvals, full MCP/config management, external-auth forms, native Diff review and rollback are not implemented yet.
  • Basic forms use native dialogs, not inline custom forms. Canceling a dialog leaves the backend question pending; Cancel question explicitly cancels it.
  • Clipboard access depends on the Webview host; if unavailable, manually select/copy text.
  • Connection recovery reloads saved history. Transient output emitted during a disconnected interval is only recoverable insofar as the backend persists it.

Security

  • Restricted/untrusted workspaces cannot activate this extension.
  • Service credentials stay inside the extension host and its trusted workers and are never sent to the Webview.
  • Markdown is sanitized; command/script links and embedded external images are blocked.
  • External links and files outside the current directory require confirmation.
  • No telemetry, no model credential management, no direct shell bridge from the Webview, and no automatic message retries.
  • Adding code context and sending prompts may disclose code to your configured model provider, just as using OpenCode directly does.

Reference: OpenCode V2 client guide and V2 API.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft