Skip to content

fix(plugin): add env parameter to WorkspaceAdaptor.create type#23235

Open
jamesmurdza wants to merge 1 commit intoanomalyco:devfrom
jamesmurdza:fix/workspace-adaptor-create-env-type
Open

fix(plugin): add env parameter to WorkspaceAdaptor.create type#23235
jamesmurdza wants to merge 1 commit intoanomalyco:devfrom
jamesmurdza:fix/workspace-adaptor-create-env-type

Conversation

@jamesmurdza
Copy link
Copy Markdown
Contributor

@jamesmurdza jamesmurdza commented Apr 18, 2026

Align the published plugin type with the control-plane signature in packages/opencode/src/control-plane/types.ts, which already declares env as the second parameter and matches the runtime invocation at packages/opencode/src/control-plane/workspace.ts:121. No runtime change.

Issue for this PR

Closes #23233

Type of change

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

What does this PR do?

Aligns the published plugin type with the control-plane signature. The control-plane type and call site already agree; only the plugin-facing type was inconsistent. Plugin authors implementing custom remote workspace adaptors lacked the env parameter in create, so forwarded env vars (OPENCODE_AUTH_CONTENT, OPENCODE_WORKSPACE_ID, OPENCODE_EXPERIMENTAL_WORKSPACES, OTEL_EXPORTER_OTLP_*) never reached the sandbox.

How did you verify your code works?

Ran bun run typecheck in packages/plugin → passes. The widened type is safe: TypeScript allows implementations with fewer parameters, so adaptors typed as (config) or (config, env) still compile.

Screenshots / recordings

N/A — type-only change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes

Align the published plugin type with the control-plane signature in
packages/opencode/src/control-plane/types.ts, which already declares
`env` as the second parameter and is what the runtime invokes at
packages/opencode/src/control-plane/workspace.ts:121. No runtime change.

Closes anomalyco#23233
@github-actions github-actions bot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Apr 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No "Type of change" checkbox is checked. Please select at least one.
  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 18, 2026
@github-actions github-actions bot closed this Apr 18, 2026
@jlongster jlongster reopened this Apr 18, 2026
@jlongster
Copy link
Copy Markdown
Contributor

Thank you!

@jlongster jlongster self-assigned this Apr 18, 2026
@jlongster jlongster self-requested a review April 18, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants