feat(conversation-memory): improve MCP installation error handling - #373
Conversation
- Copy mcp-server-wrapper.mjs to dist/ during build for cached plugins - Update .mcp.json to use dist/mcp-wrapper.mjs for consistent behavior - Ensures npm install runs automatically when node_modules is missing Fixes issue where cached plugins lacked the wrapper script needed for automatic dependency installation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add stderr capture and error analysis to provide actionable error messages when dependency installation or build fails. Changes: - Capture stderr output in runNpmInstall() and runBuild() - Analyze common error patterns (EACCES, ENOSPC, network errors) - Display cause and fix suggestions for each error type - Add Troubleshooting section to README with detailed solutions Benefits: - Users can self-diagnose and fix installation issues - Clear error messages reduce support burden - No breaking changes, minimal code addition (+31 lines) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughUpdated the conversation-memory plugin's MCP server wrapper distribution workflow by changing the entrypoint path in configuration, adding a build step to copy the wrapper to the dist directory, and enhancing the wrapper script with improved error diagnostics for installation and build failures. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plugins/conversation-memory/README.md`:
- Around line 329-357: The markdown has fenced code blocks inside numbered lists
without blank lines which trips the linter; update the README.md sections around
the "Try installing manually:" list item and the "Disk Space Full (ENOSPC)"
section to insert a blank line before each opening ```bash fence and a blank
line after each closing ``` fence (e.g., the npm proxy block, the manual install
block, and the npm cache / node_modules blocks) so the code fences are separated
from list text and headings; ensure the numbered list numbers and the "Disk
Space Full (ENOSPC)" heading remain unchanged while only adding the blank lines
around the triple-backtick blocks.
🧹 Nitpick comments (2)
plugins/conversation-memory/scripts/mcp-server-wrapper.mjs (2)
27-64: Error analysis logic looks good, minor cross-platform consideration.The stderr capture and error pattern analysis provide helpful diagnostics. Two observations:
- The EACCES fix (
sudo chown -R $(whoami) ~/.npm) is Unix-specific. On Windows, this message won't help users.- When no pattern matches, users get no cause/fix guidance—consider adding a generic fallback.
💡 Optional: Add platform-aware messaging and fallback
// Analyze error cause if (stderrOutput.includes('EACCES') || stderrOutput.includes('permission denied')) { console.error('Cause: Permission denied'); - console.error('Fix: sudo chown -R $(whoami) ~/.npm'); + if (process.platform === 'win32') { + console.error('Fix: Run terminal as Administrator'); + } else { + console.error('Fix: sudo chown -R $(whoami) ~/.npm'); + } } else if (stderrOutput.includes('ENOSPC')) { console.error('Cause: Disk space full'); console.error('Fix: Free up disk space'); } else if (/ETIMEDOUT|ECONNRESET|ENOTFOUND/i.test(stderrOutput)) { console.error('Cause: Network error'); console.error('Fix: Check internet connection and retry'); + } else { + console.error('Cause: See error output above'); }
106-119: Duplicated error analysis; network check less relevant for builds.This error analysis block is identical to the one in
runNpmInstall. Consider extracting a shared helper. Also, network errors (ETIMEDOUT, ECONNRESET, ENOTFOUND) are unlikely duringnpm run buildsince builds typically don't fetch packages—this check may confuse users if it matches unrelated error text.♻️ Extract shared error analysis helper
+function analyzeAndLogError(stderrOutput, context) { + if (stderrOutput.includes('EACCES') || stderrOutput.includes('permission denied')) { + console.error('Cause: Permission denied'); + console.error('Fix: sudo chown -R $(whoami) ~/.npm'); + } else if (stderrOutput.includes('ENOSPC')) { + console.error('Cause: Disk space full'); + console.error('Fix: Free up disk space'); + } else if (context === 'install' && /ETIMEDOUT|ECONNRESET|ENOTFOUND/i.test(stderrOutput)) { + console.error('Cause: Network error'); + console.error('Fix: Check internet connection and retry'); + } +}Then call
analyzeAndLogError(stderrOutput, 'install')inrunNpmInstallandanalyzeAndLogError(stderrOutput, 'build')inrunBuild.
| 1. Check your internet connection | ||
| 2. If behind a corporate firewall, configure npm proxy: | ||
| ```bash | ||
| npm config set proxy http://your-proxy:port | ||
| npm config set https-proxy http://your-proxy:port | ||
| ``` | ||
| 3. Try installing manually: | ||
| ```bash | ||
| cd plugins/conversation-memory | ||
| npm install | ||
| ``` | ||
|
|
||
| #### Disk Space Full (ENOSPC) | ||
|
|
||
| **Symptoms:** Error messages containing "ENOSPC" | ||
|
|
||
| **Fix:** | ||
|
|
||
| 1. Check available disk space: `df -h` | ||
| 2. Free up space by cleaning npm cache: | ||
| ```bash | ||
| npm cache clean --force | ||
| ``` | ||
| 3. Remove old node_modules: | ||
| ```bash | ||
| cd plugins/conversation-memory | ||
| rm -rf node_modules | ||
| npm install | ||
| ``` |
There was a problem hiding this comment.
Fix markdown formatting: add blank lines around fenced code blocks.
The linter flagged missing blank lines around code blocks in numbered lists (lines 331-334, 336, 349-353). This can cause rendering issues in some markdown parsers.
📝 Proposed fix for markdown formatting
1. Check your internet connection
2. If behind a corporate firewall, configure npm proxy:
+
```bash
npm config set proxy http://your-proxy:port
npm config set https-proxy http://your-proxy:port
```
+
3. Try installing manually:
+
```bash
cd plugins/conversation-memory
npm install
```
+
#### Disk Space Full (ENOSPC)
**Symptoms:** Error messages containing "ENOSPC"
**Fix:**
1. Check available disk space: `df -h`
2. Free up space by cleaning npm cache:
+
```bash
npm cache clean --force
```
+
3. Remove old node_modules:
+
```bash
cd plugins/conversation-memory
rm -rf node_modules
npm install
```📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 1. Check your internet connection | |
| 2. If behind a corporate firewall, configure npm proxy: | |
| ```bash | |
| npm config set proxy http://your-proxy:port | |
| npm config set https-proxy http://your-proxy:port | |
| ``` | |
| 3. Try installing manually: | |
| ```bash | |
| cd plugins/conversation-memory | |
| npm install | |
| ``` | |
| #### Disk Space Full (ENOSPC) | |
| **Symptoms:** Error messages containing "ENOSPC" | |
| **Fix:** | |
| 1. Check available disk space: `df -h` | |
| 2. Free up space by cleaning npm cache: | |
| ```bash | |
| npm cache clean --force | |
| ``` | |
| 3. Remove old node_modules: | |
| ```bash | |
| cd plugins/conversation-memory | |
| rm -rf node_modules | |
| npm install | |
| ``` | |
| 1. Check your internet connection | |
| 2. If behind a corporate firewall, configure npm proxy: |
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)
[warning] 331-331: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 334-334: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 336-336: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 349-349: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 351-351: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 353-353: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
🤖 Prompt for AI Agents
In `@plugins/conversation-memory/README.md` around lines 329 - 357, The markdown
has fenced code blocks inside numbered lists without blank lines which trips the
linter; update the README.md sections around the "Try installing manually:" list
item and the "Disk Space Full (ENOSPC)" section to insert a blank line before
each opening ```bash fence and a blank line after each closing ``` fence (e.g.,
the npm proxy block, the manual install block, and the npm cache / node_modules
blocks) so the code fences are separated from list text and headings; ensure the
numbered list numbers and the "Disk Space Full (ENOSPC)" heading remain
unchanged while only adding the blank lines around the triple-backtick blocks.
# [5.0.0](v4.3.0...v5.0.0) (2026-02-05) ### Bug Fixes * **ci:** disable strict status checks to allow semantic-release commits ([7b296a4](7b296a4)) * **ci:** merge Release workflow into CI workflow with proper dependency ([906673e](906673e)) * **ci:** trigger CI on release-please PRs using workflow_run ([33ff7d3](33ff7d3)) * **ci:** update branch protection to match GitHub Actions status check format ([13efcf5](13efcf5)) * enable glob pattern for plugin.json version updates ([86fd628](86fd628)) * **handoff:** output notification to stderr to exclude from LLM context ([463bb08](463bb08)) * **marketplace:** remove databricks plugin reference ([f0bc6b8](f0bc6b8)) * **ralph-loop:** fix hooks matcher and stdin handling ([326a570](326a570)) * set release-please manifest to start from 4.3.0 ([#377](#377)) ([23a6cba](23a6cba)) ### Features * **bash-lsp:** add Bash Language Server plugin ([#394](#394)) ([7770f3d](7770f3d)) * **ci:** replace release-please with semantic-release ([35d346f](35d346f)) * **conversation-memory:** add automatic npm install when node_modules missing ([db55514](db55514)) * **conversation-memory:** add marked dependency for markdown rendering ([1887174](1887174)) * **conversation-memory:** improve MCP installation error handling ([#373](#373)) ([16eb7b7](16eb7b7)) * **conversation-memory:** reduce token usage in summarization ([d921bc7](d921bc7)) * **conversation-memory:** reduce token usage in summarization ([b3a245b](b3a245b)) * **handoff:** add session handoff plugin for context transfer ([#374](#374)) ([35cfb0c](35cfb0c)) * **me:** add tdd and spawn commands ([#371](#371)) ([9af9bbe](9af9bbe)) * migrate from semantic-release to Release Please ([#375](#375)) ([d20c736](d20c736)) * **release-please:** add auto-merge for release PRs ([cef4678](cef4678)) * **test-helpers:** extract shared BATS helpers to @baleen/bats-helpers package ([19f2a62](19f2a62)) * **tests:** run plugin tests in parallel using background processes ([04be773](04be773)) ### Performance Improvements * **tests:** add caching to improve test execution speed ([9bbee5b](9bbee5b)) ### BREAKING CHANGES * Release workflow now requires merging Release Please PRs instead of automatic releases on push to main. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* chore: prepare for 5.0.0 release * chore(release): 5.0.0 # [5.0.0](v4.3.0...v5.0.0) (2026-02-05) ### Bug Fixes * **ci:** disable strict status checks to allow semantic-release commits ([7b296a4](7b296a4)) * **ci:** merge Release workflow into CI workflow with proper dependency ([906673e](906673e)) * **ci:** trigger CI on release-please PRs using workflow_run ([33ff7d3](33ff7d3)) * **ci:** update branch protection to match GitHub Actions status check format ([13efcf5](13efcf5)) * enable glob pattern for plugin.json version updates ([86fd628](86fd628)) * **handoff:** output notification to stderr to exclude from LLM context ([463bb08](463bb08)) * **marketplace:** remove databricks plugin reference ([f0bc6b8](f0bc6b8)) * **ralph-loop:** fix hooks matcher and stdin handling ([326a570](326a570)) * set release-please manifest to start from 4.3.0 ([#377](#377)) ([23a6cba](23a6cba)) ### Features * **bash-lsp:** add Bash Language Server plugin ([#394](#394)) ([7770f3d](7770f3d)) * **ci:** replace release-please with semantic-release ([35d346f](35d346f)) * **conversation-memory:** add automatic npm install when node_modules missing ([db55514](db55514)) * **conversation-memory:** add marked dependency for markdown rendering ([1887174](1887174)) * **conversation-memory:** improve MCP installation error handling ([#373](#373)) ([16eb7b7](16eb7b7)) * **conversation-memory:** reduce token usage in summarization ([d921bc7](d921bc7)) * **conversation-memory:** reduce token usage in summarization ([b3a245b](b3a245b)) * **handoff:** add session handoff plugin for context transfer ([#374](#374)) ([35cfb0c](35cfb0c)) * **me:** add tdd and spawn commands ([#371](#371)) ([9af9bbe](9af9bbe)) * migrate from semantic-release to Release Please ([#375](#375)) ([d20c736](d20c736)) * **release-please:** add auto-merge for release PRs ([cef4678](cef4678)) * **test-helpers:** extract shared BATS helpers to @baleen/bats-helpers package ([19f2a62](19f2a62)) * **tests:** run plugin tests in parallel using background processes ([04be773](04be773)) ### Performance Improvements * **tests:** add caching to improve test execution speed ([9bbee5b](9bbee5b)) ### BREAKING CHANGES * Release workflow now requires merging Release Please PRs instead of automatic releases on push to main. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor(bash-lsp): migrate from MCP to LSP configuration - Remove .mcp.json file - Add lspServers field to plugin.json with bash-language-server config - Add .bats extension support for BATS test files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test(bats): add lspServers to allowed plugin.json fields - Add lspServers to json_field_is_allowed function - Update error message to include lspServers in allowed fields list Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
# [5.0.0](v4.3.0...v5.0.0) (2026-02-05) ### Bug Fixes * **ci:** disable strict status checks to allow semantic-release commits ([7b296a4](7b296a4)) * **ci:** merge Release workflow into CI workflow with proper dependency ([906673e](906673e)) * **ci:** trigger CI on release-please PRs using workflow_run ([33ff7d3](33ff7d3)) * **ci:** update bats-action to latest commit ([106b1f3](106b1f3)) * **ci:** update branch protection to match GitHub Actions status check format ([13efcf5](13efcf5)) * **ci:** use full commit SHA for bats-action ([9a70f52](9a70f52)) * **commands:** correct sdd command skill reference ([#403](#403)) ([a4db99c](a4db99c)) * enable glob pattern for plugin.json version updates ([86fd628](86fd628)) * **handoff:** output notification to stderr to exclude from LLM context ([463bb08](463bb08)) * **marketplace:** remove databricks plugin reference ([f0bc6b8](f0bc6b8)) * **ralph-loop:** fix hooks matcher and stdin handling ([326a570](326a570)) * **release:** add owner parameter to GitHub App token generation ([#401](#401)) ([b910a20](b910a20)) * **release:** remove GitHub App token generation ([ced7b17](ced7b17)) * **release:** restore GitHub App token generation ([45dd490](45dd490)) * **release:** use GitHub App token with Administration permission ([4077ecd](4077ecd)) * **release:** use GitHub App token with Administration permission ([#411](#411)) ([e6b1e9c](e6b1e9c)) * **release:** use GITHUB_TOKEN directly with github-actions[bot] bypass ([c7b517c](c7b517c)) * **release:** use GITHUB_TOKEN instead of custom GitHub App ([76a2a00](76a2a00)) * **release:** use secrets.GITHUB_TOKEN directly ([a2aaf50](a2aaf50)) * set release-please manifest to start from 4.3.0 ([#377](#377)) ([23a6cba](23a6cba)) ### Features * **bash-lsp:** add Bash Language Server plugin ([#394](#394)) ([7770f3d](7770f3d)) * **ci:** replace release-please with semantic-release ([35d346f](35d346f)) * **conversation-memory:** add automatic npm install when node_modules missing ([db55514](db55514)) * **conversation-memory:** add file-based logging system ([81f65bd](81f65bd)) * **conversation-memory:** add marked dependency for markdown rendering ([1887174](1887174)) * **conversation-memory:** improve MCP installation error handling ([#373](#373)) ([16eb7b7](16eb7b7)) * **conversation-memory:** reduce token usage in summarization ([d921bc7](d921bc7)) * **conversation-memory:** reduce token usage in summarization ([b3a245b](b3a245b)) * **databricks-devtools:** add Databricks CLI wrapper plugin ([#408](#408)) ([7baf422](7baf422)) * **handoff:** add session handoff plugin for context transfer ([#374](#374)) ([35cfb0c](35cfb0c)) * **lsp-support:** add Kotlin, Lua, Nix LSP servers, merge bash-lsp ([8f1ee4f](8f1ee4f)) * **me:** add commit skill ([8d0cf1c](8d0cf1c)) * **me:** add tdd and spawn commands ([#371](#371)) ([9af9bbe](9af9bbe)) * migrate from semantic-release to Release Please ([#375](#375)) ([d20c736](d20c736)) * **release-please:** add auto-merge for release PRs ([cef4678](cef4678)) * **test-helpers:** extract shared BATS helpers to @baleen/bats-helpers package ([19f2a62](19f2a62)) * **tests:** run plugin tests in parallel using background processes ([04be773](04be773)) ### Performance Improvements * **tests:** add caching to improve test execution speed ([9bbee5b](9bbee5b)) ### BREAKING CHANGES * Release workflow now requires merging Release Please PRs instead of automatic releases on push to main. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* chore: prepare for 5.0.0 release * chore(release): 5.0.0 # [5.0.0](baleen37/bstack@v4.3.0...v5.0.0) (2026-02-05) ### Bug Fixes * **ci:** disable strict status checks to allow semantic-release commits ([7b296a4](baleen37/bstack@7b296a4)) * **ci:** merge Release workflow into CI workflow with proper dependency ([906673e](baleen37/bstack@906673e)) * **ci:** trigger CI on release-please PRs using workflow_run ([33ff7d3](baleen37/bstack@33ff7d3)) * **ci:** update branch protection to match GitHub Actions status check format ([13efcf5](baleen37/bstack@13efcf5)) * enable glob pattern for plugin.json version updates ([86fd628](baleen37/bstack@86fd628)) * **handoff:** output notification to stderr to exclude from LLM context ([463bb08](baleen37/bstack@463bb08)) * **marketplace:** remove databricks plugin reference ([f0bc6b8](baleen37/bstack@f0bc6b8)) * **ralph-loop:** fix hooks matcher and stdin handling ([326a570](baleen37/bstack@326a570)) * set release-please manifest to start from 4.3.0 ([#377](baleen37/bstack#377)) ([23a6cba](baleen37/bstack@23a6cba)) ### Features * **bash-lsp:** add Bash Language Server plugin ([#394](baleen37/bstack#394)) ([7770f3d](baleen37/bstack@7770f3d)) * **ci:** replace release-please with semantic-release ([35d346f](baleen37/bstack@35d346f)) * **conversation-memory:** add automatic npm install when node_modules missing ([db55514](baleen37/bstack@db55514)) * **conversation-memory:** add marked dependency for markdown rendering ([1887174](baleen37/bstack@1887174)) * **conversation-memory:** improve MCP installation error handling ([#373](baleen37/bstack#373)) ([16eb7b7](baleen37/bstack@16eb7b7)) * **conversation-memory:** reduce token usage in summarization ([d921bc7](baleen37/bstack@d921bc7)) * **conversation-memory:** reduce token usage in summarization ([b3a245b](baleen37/bstack@b3a245b)) * **handoff:** add session handoff plugin for context transfer ([#374](baleen37/bstack#374)) ([35cfb0c](baleen37/bstack@35cfb0c)) * **me:** add tdd and spawn commands ([#371](baleen37/bstack#371)) ([9af9bbe](baleen37/bstack@9af9bbe)) * migrate from semantic-release to Release Please ([#375](baleen37/bstack#375)) ([d20c736](baleen37/bstack@d20c736)) * **release-please:** add auto-merge for release PRs ([cef4678](baleen37/bstack@cef4678)) * **test-helpers:** extract shared BATS helpers to @baleen/bats-helpers package ([19f2a62](baleen37/bstack@19f2a62)) * **tests:** run plugin tests in parallel using background processes ([04be773](baleen37/bstack@04be773)) ### Performance Improvements * **tests:** add caching to improve test execution speed ([9bbee5b](baleen37/bstack@9bbee5b)) ### BREAKING CHANGES * Release workflow now requires merging Release Please PRs instead of automatic releases on push to main. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor(bash-lsp): migrate from MCP to LSP configuration - Remove .mcp.json file - Add lspServers field to plugin.json with bash-language-server config - Add .bats extension support for BATS test files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test(bats): add lspServers to allowed plugin.json fields - Add lspServers to json_field_is_allowed function - Update error message to include lspServers in allowed fields list Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary
Changes
1. Auto-install dependencies via bundled wrapper (#1: 8b60373)
Problem: Users had to manually run
npm installbefore using the plugin, causing friction.Solution:
mcp-server-wrapper.mjsthat checks and installs dependencies automatically.mcp.jsonto use wrapper instead of direct server executionnpm installon first runBenefits:
2. Improve MCP installation error messages (#2: 3ba59a8)
Problem: When installation fails, users only see "exit code 1" without knowing what went wrong.
Solution:
runNpmInstall()andrunBuild()sudo chown -R $(whoami) ~/.npmBenefits:
Modified Files
plugins/conversation-memory/.mcp.jsonplugins/conversation-memory/scripts/mcp-server-wrapper.mjsplugins/conversation-memory/scripts/build.mjsplugins/conversation-memory/dist/mcp-wrapper.mjsplugins/conversation-memory/README.mdplugins/conversation-memory/dist/*.mjsTest Plan
rm -rf node_modules && node dist/mcp-wrapper.mjsnpm run build🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation