Skip to content

fix(drive): update Effect and OpenCode V2 compatibility - #67

Merged
kitlangton merged 1 commit into
mainfrom
update-drive
Aug 28, 2026
Merged

fix(drive): update Effect and OpenCode V2 compatibility#67
kitlangton merged 1 commit into
mainfrom
update-drive

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

Drive 1.4.5 still pins Effect beta.101 and an older V2 client. Current V2 dynamic-tool notifications use context.id, which the old Drive protocol cannot decode; updating dependencies alone also breaks schema-backed errors, RPC codecs, and omitted CLI boolean flags.

What Changes

Dependency Before After
effect 4.0.0-beta.101 4.0.0-rc.111 (exact peer)
@effect/platform-node 4.0.0-beta.101 4.0.0-rc.111
@effect/platform-node-shared 4.0.0-beta.101 4.0.0-rc.111
@effect/vitest 4.0.0-beta.101 4.0.0-rc.111
@opencode-ai/client 0.0.0-next-17010 0.0.0-dev-18516
  • Use Schema.TaggedError and provide the JSON codec required by Effect RPC.
  • Preserve start --name demo and other CLI behavior with explicit false defaults for optional boolean flags.
  • Copy current V2 JSON-RPC response exclusivity, unique negotiated capabilities, dynamic-tool progress records, and invocation context fields.
  • Static tool adapters emit native progress metadata, terminal result metadata, and Tool.Error failures while retaining their public controlled-call API.
  • Update affected catalog schemas, fixtures, documentation, and the lifecycle probe's session.inbox.list integration.

Dynamic controls now match the canonical V2 protocol:

// Before
yield* invocation.progress({ structured: { phase: "searching" } })
invocation.context.callID

// After
yield* invocation.progress({ phase: "searching" })
invocation.context.id

// Unchanged: terminal output and producer identity
yield* invocation.finish({ structured: { answer: 42 }, content: [{ type: "text", text: "42" }] })
invocation.id

Effect Alignment

Registry checks found Effect rc.112 is newer, but the newest V2 client (dev-18516) and its protocol/schema packages still require exactly rc.111. This PR uses the latest coherent V2 dependency set instead of overriding the published client's contract or accidentally selecting Effect V3 through latest.

Effect is an exact peer because Drive exposes Effect values in its public API. A workspace override prevents Bun's isolated linker from selecting a newer platform-node-shared through the platform package's caret dependency. The clean packed consumer resolved one Effect rc.111 runtime without overrides.

Scope

Compatibility update only: LLM queue/send/serve/title sequencing, two-sided waiting, mode exclusivity, cancellation, reconnection, run-wide supervision, and settlement retain their contracts. No shared response language or controller redesign.

The major changeset records the public dynamic-tool shape migration. The package version remains 1.4.5 pending the normal approved Changesets release; this PR does not publish npm or change an installed CLI.

Verification

# packages/drive
bun run check
bun typecheck
bun run release:validate
bun run drive run ./test/manual/current-v2.ts
bun pm pack --destination ../../.tmp

# apps/catalog
bun run check

# isolated OpenCode checkout, packages/simulation, private HOME/XDG/config
bun run test

# fresh packed consumer
bun typecheck
bun node_modules/opencode-drive/bin/opencode-drive run ./consumer.ts
bun node_modules/opencode-drive/bin/opencode-drive run ../../packages/drive/test/manual/current-v2.ts
  • Final release validation: 244 Effect tests and 58 CLI integration tests pass.
  • Catalog check: lint, types, generation consistency, 40 tests, and browser/Bun builds pass.
  • OpenCode simulation: 42 tests pass against 6fad330efceb5af8e49d558394ddb492fca259db from origin/v2 with isolated HOME/XDG/config.
  • Both source and packed CLI smoke runs use OPENCODE_DRIVE_DEV pointing to that isolated checkout, negotiate both endpoint roles at protocol V1 with compatibility required, and verify queued replies, title handling, SDK inbox/event APIs, static/dynamic tool progress and completion, capture, PNG, and settlement.
  • A temporary checked defineScript fixture also passes two explicit server/TUI generations with queued replies and backend relaunch.
  • Inspected the 102-file tarball (1.62 MB, SHA-1 5622f14b8d63257a5824c1f64b705e6f334dba75): all seven public entry points, CLI, runtime config/plugin, and fonts are included; tests, catalog, and node_modules are excluded. A fresh consumer typechecks and imports all entry points with client/protocol/schema dev-18516 and a single Effect rc.111.
  • One pre-existing lint warning remains in recording/marks.ts. An earlier overlapping validation run failed once on a missing detached-owner log; two focused reruns and final full validation pass. No live user sessions, real providers, or elected OpenCode server replacement were used.

@kitlangton
kitlangton merged commit 04013ce into main Aug 28, 2026
1 check passed
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