Skip to content

feat(opencode): add experimental Mainbrella workspaces - #53943

Closed
andrewarrow wants to merge 1 commit into
anomalyco:devfrom
mainbrella:mainbrella-workspaces
Closed

andrewarrow wants to merge 1 commit into
anomalyco:devfrom
mainbrella:mainbrella-workspaces

Conversation

@andrewarrow

@andrewarrow andrewarrow commented Oct 8, 2026 •

Copy link
Copy Markdown

Issue for this PR

Related to #48411 (sandboxed execution).

Type of change

  • New feature
  • Bug fix
  • Refactor / code improvement
  • Documentation

What does this PR do?

https://mainbrella.com/blog/opencode-one-workspace/

Adds an opt-in Mainbrella workspace adapter for an explicitly prepared sandbox generation. It starts a matching OpenCode server in a dedicated tmux socket, connects through a protected preview, renews expired previews, and removes its server and preview without stopping the user's machine. Setup and recovery instructions are included beside the adapter.

Uses existing Mainbrella APIs with no backend changes or new dependencies. Sandbox preparation and provider authentication remain explicit; the adapter does not copy host credentials. Connection receipts stay in private local state. Ambiguous preview creation requires reconciliation rather than automatic retry.

Workspace sync now resolves the adapter target on reconnect so renewed preview URLs take effect. The proxy drops local authentication and cookies, and transport error logs omit credential-bearing targets and response bodies.

How did you verify your code works?

  • bun typecheck in packages/opencode passed.
  • 86 targeted tests passed across the adapter, plugin registration, workspace lifecycle/routing, HTTP proxy, and WebSocket suites.
  • The adapter test launches the actual OpenCode server through tmux, reads a file from a guest-style directory containing quotes, and verifies shutdown. This test skips where tmux is unavailable.
  • Lint reported no errors or new warnings; formatting and git diff --check passed.

This is a draft: live Cloudflare sandbox validation remains outstanding. Existing sandbox lease limits and uncertain-preview recovery are documented.

Screenshots / recordings

Uses the existing experimental workspace picker.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@thdxr thdxr closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants