fix: resolve ACP stdio MCP proxy without import.meta in CJS bundle - #81
Merged
Merged
Conversation
The CLI ships as CJS, so import.meta.url is empty and URL.pathname breaks Windows paths. Locate mcpProxy.mjs like the PTY worker and copy it to dist/workers during bundle.
Killea
added a commit
that referenced
this pull request
Aug 23, 2026
Apply the same CJS-safe path resolution pattern from PR #81 to the V2 socket proxy (proxy.mjs). Both import.meta.url references in acpAdapter.ts are now replaced with path-based resolvers, eliminating all empty-import-meta esbuild warnings. The new resolveAcpSocketProxyScript() mirrors resolveAcpMcpProxyScript(), using process.argv[1] + cwd candidates with existsSync fallbacks. On Windows, path.resolve returns native C:\ paths (no /C:/ prefix), making the result safe for spawn()/child_process. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
import.meta.urlis empty andURL.pathnameproduces unusable Windows paths (/C:/...).mcpProxy.mjsthe same way as the PTY worker (argv+cwdcandidates) and copy it todist/workersat bundle time.Test plan
npx vitest run tests/unit/test_acp_mcp_proxy_path.test.ts tests/unit/test_acp_adapter.test.tsnpm run checknode ./scripts/build-bundle.mjs— noimport.metawarning;dist/workers/mcpProxy.mjspresentAGENTCHATBUS_BASE_URLset and confirm the stdio MCP proxy path exists