Skip to content

fix(drive): support live current OpenCode checkouts - #46

Closed
kitlangton wants to merge 2 commits into
anomalyco:mainfrom
kitlangton:update-opencode-drive
Closed

fix(drive): support live current OpenCode checkouts#46
kitlangton wants to merge 2 commits into
anomalyco:mainfrom
kitlangton:update-opencode-drive

Conversation

@kitlangton

@kitlangton kitlangton commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

Restore live --dev compatibility with current OpenCode checkouts. Drive now provides the simulated model through the current provider contract, bridges the current TUI plugin host and transport, and launches V2 checkouts through their isolated standalone server path.

Before / After

Before: Starting Drive against a current OpenCode checkout produced an empty provider list. The TUI opened Connect a provider, Drive never reached readiness, and start timed out. V2 checkouts also respawned a managed Bun service without Drive's Solid preloads, causing the child process to exit while compiling TSX.

After: Drive waits for the simulated provider, supplies the current provider and legacy bootstrap surfaces, and exposes UI/LLM control over its bridge. Checkouts with V2 standalone support use a private in-process server; managed-service checkouts inherit the required Bun preloads.

How

  • packages/drive/src/instance/default-config.jsonc uses the current provider API shape.
  • packages/drive/src/instance/dev-integration.ts provides the UI WebSocket bridge and OpenAI-compatible streaming simulation transport.
  • packages/drive/src/instance/dev-preload.ts installs the bridge at the current TUI plugin-host seams.
  • packages/drive/src/instance/dev.ts prepares absolute inheritable preloads and selects --standalone when the checkout supports it.
  • packages/drive/src/instance/runtime.ts propagates dev preloads through BUN_OPTIONS so child Bun processes retain them.
  • Drive dependencies now align with the current Effect and OpenCode client versions.

Scope

This currently restores detached live start --dev usage only. Scripted --dev is not release-ready: the V2 path still needs a separate service launch boundary and current service-discovery client compatibility. Normal installed opencode2 launches and OpenCode provider behavior are unchanged.

Testing

  • bun run release:validate
  • 208 Effect tests and 57 CLI integration tests passed
  • Packed artifact validation passed
  • Live detached smoke against OpenCode origin/v2 at 3c259fc552: Drive reached ready, Simulated Model loaded without Connect a provider, ui.state returned the focused editor, and Ctrl-P, typing, and Enter commands executed
  • Live detached smoke against OpenCode dev at 1e17856ba4 passed
  • Scripted V2 smoke remains failing and must pass before release

Flow

sequenceDiagram
  participant Drive
  participant TUI as OpenCode TUI
  participant Server as Standalone server
  participant Sim as Drive simulation backend
  Drive->>TUI: launch with Solid + Drive preloads
  TUI->>Server: start isolated V2 server
  Server->>Sim: stream OpenAI-compatible model requests
  Sim-->>Server: SSE chunks and finish
  TUI-->>Drive: UI control WebSocket ready
Loading

@kitlangton kitlangton changed the title fix(drive): support current OpenCode checkouts fix(drive): support live current OpenCode checkouts Jul 30, 2026
@kitlangton

Copy link
Copy Markdown
Contributor Author

Closing this in favor of a smaller replacement. Current OpenCode already owns the Drive frontend/backend under packages/simulation; this PR duplicated that runtime and its source-rewrite hook did not run against the V2 revision used by the successful smoke test. The replacement will keep only the V2 standalone launch adaptation and validate the real native simulation path end to end.

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.

1 participant