Fix Glama MCP startup#167
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ace2b58058
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| try { | ||
| return import.meta.url === pathToFileURL(realpathSync(entrypoint)).href; |
There was a problem hiding this comment.
Handle preserve-symlinks-main bin launches
When users launch the package bin symlink with NODE_OPTIONS=--preserve-symlinks-main or node --preserve-symlinks-main, Node keeps import.meta.url as the symlink URL while this check compares it only to the realpath target, so isCurrentFileEntrypoint() returns false and main() never starts, leaving MCP clients without a handshake. The old guard succeeded in that mode; compare against both the realpath URL and the original entrypoint URL.
Useful? React with 👍 / 👎.
Summary\n- start the Glama Docker image through the package's real dist entrypoint instead of the npm bin symlink\n- make the MCP package entrypoint guard symlink-safe for future package releases\n\n## Verification\n- pnpm --filter @dialectos/mcp build\n- pnpm --filter @dialectos/mcp test\n- MCP client handshake against node packages/mcp/dist/index.js returned 17 tools
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.