Skip to content

fix(plugin): guard MCP auto-registration with binary check (#1237)#1239

Merged
JeremyDev87 merged 1 commit into
masterfrom
fix/guard-mcp-binary-check-1237
Apr 3, 2026
Merged

fix(plugin): guard MCP auto-registration with binary check (#1237)#1239
JeremyDev87 merged 1 commit into
masterfrom
fix/guard-mcp-binary-check-1237

Conversation

@JeremyDev87

Copy link
Copy Markdown
Owner

Summary

  • Guard _ensure_mcp_json() with shutil.which('codingbuddy') check so plugin-only users without the binary don't get broken MCP config
  • Add two tests: binary absent (mcp.json not created) and binary present (mcp.json created normally)

Closes #1237

Test plan

  • python3 -m pytest hooks/test_session_start.py -v -k "mcp" — 6 passed
  • python3 -m pytest hooks/test_session_start.py -v — 34 passed

Guard _ensure_mcp_json() with shutil.which('codingbuddy') so plugin-only
users without the codingbuddy binary don't get broken MCP config.
@JeremyDev87 JeremyDev87 added the fix label Apr 3, 2026
@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Apr 3, 2026 5:22pm

@JeremyDev87 JeremyDev87 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: ✅ APPROVE

CI Status: ALL PASS

Code Review

session-start.py — Minimal, effective guard:

  • shutil.which("codingbuddy") check before _ensure_mcp_json() — prevents broken MCP config for plugin-only users
  • Local import _shutil inside try block — safe pattern

test_session_start.py — Two tests covering both paths:

  • test_skips_mcp_json_when_binary_not_installed: Verifies mcp.json not created when binary missing
  • test_creates_mcp_json_when_binary_installed: Verifies normal creation when binary exists

Issues Found: None

Recommendation: APPROVE

@JeremyDev87 JeremyDev87 self-assigned this Apr 3, 2026
@JeremyDev87 JeremyDev87 merged commit 408197c into master Apr 3, 2026
28 checks passed
@JeremyDev87 JeremyDev87 deleted the fix/guard-mcp-binary-check-1237 branch April 3, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(plugin): guard MCP auto-registration with codingbuddy binary check

1 participant