Skip to content

fix(drive): launch current V2 checkouts - #47

Closed
kitlangton wants to merge 1 commit into
mainfrom
v2-dev-launch
Closed

fix(drive): launch current V2 checkouts#47
kitlangton wants to merge 1 commit into
mainfrom
v2-dev-launch

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Launch current OpenCode V2 development checkouts through OpenCode's native simulation frontend and backend. This supersedes #46 with the small launch adaptation that the current V2 architecture actually needs.

Before / After

Before: Detached start --dev launched the V2 TUI through its managed background-service path, so the TUI exited before Drive's UI endpoint became ready. Scripted runs also launched their managed service on V2's channel-wide default port, which collided with an existing local V2 service.

After: Drive detects standalone-capable V2 checkouts and adds --standalone only to the detached TUI command. Scripted runs keep separate service and TUI-client commands, with a private persisted port for the per-run managed service. Source-spawned server processes receive the Solid/browser Bun options they need, then sanitize them before tools or terminal commands inherit the environment.

How

  • src/instance/dev.ts validates the current V2 entrypoint, uses the checkout's absolute Solid preload, and generates a tiny launcher that removes inherited Bun compilation options when the process becomes a server.
  • src/instance/runtime.ts appends --standalone only for detached launch and persists an isolated scripted service port in the run's private V2 service configuration.
  • Tests cover space-containing paths, standalone detection, and server environment sanitization.

Scope

This does not add a Drive-owned simulation bridge, rewrite OpenCode source files, replace providers, or duplicate OpenCode's JSON-RPC/runtime integration. Those responsibilities remain in OpenCode's existing packages/simulation frontend and backend.

Testing

  • bun run release:validate (203 Effect/Vitest tests, 57 CLI integration tests, lint, typecheck, and pack dry run)
  • Packed opencode-drive@1.4.0 tarball installed under /tmp/opencode drive packed consumer
  • Detached packed smoke against current V2 selected through /tmp/opencode v2 checkout: ready, focused editor, Simulated Model visible, Connect a provider absent
  • Scripted packed smoke against the same V2 path: isolated service ready, TUI ready, prompt submitted, simulated LLM response rendered, service killed and relaunched on its private configuration, clean shutdown

Flow

sequenceDiagram
    participant Drive
    participant Service as V2 service
    participant TUI as V2 TUI
    participant Sim as OpenCode simulation

    alt detached
        Drive->>TUI: base source command + --standalone
        TUI->>Sim: native frontend/backend integration
    else scripted
        Drive->>Service: base source command + serve --service
        Note over Service: Private service-local.json supplies the port
        Service->>Sim: native backend integration
        Drive->>TUI: base source command
        TUI->>Service: discover isolated per-run service
        TUI->>Sim: native frontend integration
    end
Loading

@kitlangton

Copy link
Copy Markdown
Contributor Author

Superseded by #48, which includes the current V2 launch changes plus the packaged standalone-script runtime and final validation.

@kitlangton kitlangton closed this Jul 30, 2026
@kitlangton
kitlangton deleted the v2-dev-launch branch July 30, 2026 20:11
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