Skip to content

WorkspaceAdaptor.create type in @opencode-ai/plugin is missing the env parameter #23233

Description

@jamesmurdza

Description

The WorkspaceAdaptor type exported from @opencode-ai/plugin declares a 2-arg create, but opencode's internal control-plane type declares 3 args (with env in the middle) and the call site actually passes 3. Pinned to tag v1.4.11:

Plugin type (missing env)packages/plugin/src/index.ts:52:

create(config: WorkspaceInfo, from?: WorkspaceInfo): Promise<void>

Control-plane type (with env)packages/opencode/src/control-plane/types.ts:31:

create(info: WorkspaceInfo, env: Record<string, string | undefined>, from?: WorkspaceInfo): Promise<void>

Call site (passes env)packages/opencode/src/control-plane/workspace.ts:121:

await adaptor.create(config, env)

Fix

Sync the plugin-facing type with the control-plane type:

-  create(config: WorkspaceInfo, from?: WorkspaceInfo): Promise<void>
+  create(
+    config: WorkspaceInfo,
+    env: Record<string, string | undefined>,
+    from?: WorkspaceInfo,
+  ): Promise<void>

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions