Skip to content

fix(cli): resolve plugins in Node SEA builds - #47720

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
sea-module-resolver
Open

fix(cli): resolve plugins in Node SEA builds#47720
opencode-agent[bot] wants to merge 1 commit into
v2from
sea-module-resolver

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Node SEA's embedded ESM entrypoint does not provide import.meta.resolve, so plugin resolution throws before reaching the registered resolver hook.

  • Obtain the native ESM resolver from a tiny module loaded through the existing VM-backed importer. Keep the synchronous API, package export conditions, parent-directory scope, and extension fallback unchanged.
  • Exercise directory-plugin resolution in the existing compiled-service smoke test and require an active plugin, rather than merely a listed plugin. The previous standalone-file fixture bypassed resolution.

Validation

  • Util: typecheck and all 47 tests pass.
  • Plugin: typecheck and all 9 Host.resolve tests pass under Bun.
  • The same 9 resolver tests pass as normal Node 26.4 ESM and as an actual SEA executable. Before the fix, all 9 SEA tests failed with TypeError: (intermediate value).resolve is not a function.
  • CLI typecheck and changed-file formatting pass.
  • Full CLI build/smoke remains unverified locally: bundling was OOM-killed by the host's per-command memory limit, including on the unchanged base. CI runs the full Node build and strengthened compiled-service smoke.

Requested by: @rekram1-node (Aiden via Slack)

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.

1 participant