Skip to content

add project root diagnostic warning for Cursor#640

Merged
JeremyDev87 merged 3 commits intomasterfrom
fix/606-cursor-project-root-detection
Feb 25, 2026
Merged

add project root diagnostic warning for Cursor#640
JeremyDev87 merged 3 commits intomasterfrom
fix/606-cursor-project-root-detection

Conversation

@JeremyDev87
Copy link
Owner

@JeremyDev87 JeremyDev87 commented Feb 24, 2026

Summary

Fixes unreliable project root auto-detection in Cursor environments where roots/list MCP capability may not be supported, causing codingbuddy.config.json to not be found and settings to fall back to defaults.

Changes

  • ConfigService: Add ProjectRootSource type ('env' | 'roots_list' | 'auto_detect') and getProjectRootSource() getter to track how the project root was resolved
  • ConfigService: Add optional source parameter to setProjectRootAndReload() for caller-specific source tracking
  • ModeHandler: Emit projectRootWarning diagnostic in parse_mode response when project root was auto-detected and no codingbuddy.config.json was found
  • Cursor adapter docs: Add CODINGBUDDY_PROJECT_ROOT as required env var with explanation of why it's needed

Commits

  1. feat(config): track project root resolution source — ProjectRootSource type, getProjectRootSource(), source tracking in findProjectRoot/setProjectRootAndReload (4 tests)
  2. feat(mcp): add projectRootWarning diagnostic to parse_mode — warning when auto_detect + config not loaded (4 tests)
  3. docs(cursor): add CODINGBUDDY_PROJECT_ROOT setup instructions — updated .cursor/mcp.json template and added explanation note
  4. style(config): format setProjectRootAndReload signature to multi-line — code style consistency

Closes #606

Test plan

  • 78 tests passing, build succeeds
  • getProjectRootSource() returns 'env' when CODINGBUDDY_PROJECT_ROOT is set
  • getProjectRootSource() returns 'auto_detect' when no env var is set
  • setProjectRootAndReload() updates source to 'roots_list' (default) or custom value
  • projectRootWarning included only when source is auto_detect AND config not loaded
  • projectRootWarning NOT included when source is env or roots_list
  • projectRootWarning NOT included when auto_detect but config is loaded
  • Backward compatible — no breaking changes to existing API

@JeremyDev87 JeremyDev87 added bug Something isn't working documentation Improvements or additions to documentation mcp-server apps/mcp-server config Root config and rules labels Feb 24, 2026
@vercel
Copy link

vercel bot commented Feb 24, 2026

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

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Feb 25, 2026 1:14am

Add ProjectRootSource type ('env' | 'roots_list' | 'auto_detect') and
getProjectRootSource() getter to ConfigService. This enables downstream
consumers to determine how the project root was resolved and warn users
when auto-detection may have failed.
Emit projectRootWarning in parse_mode response when project root was
auto-detected and no codingbuddy.config.json was found. This guides
Cursor users to set CODINGBUDDY_PROJECT_ROOT environment variable.

Update mcp.service mock to include new ConfigService methods.
Update Cursor adapter docs to include CODINGBUDDY_PROJECT_ROOT as
required env var in .cursor/mcp.json template. Add explanation that
Cursor may not support roots/list MCP capability.

Closes #606
@JeremyDev87 JeremyDev87 force-pushed the fix/606-cursor-project-root-detection branch from 42ea20b to 373be34 Compare February 25, 2026 01:14
@JeremyDev87 JeremyDev87 self-assigned this Feb 25, 2026
@JeremyDev87 JeremyDev87 changed the title fix: add project root diagnostic warning for Cursor add project root diagnostic warning for Cursor Feb 25, 2026
@JeremyDev87 JeremyDev87 merged commit a123bd5 into master Feb 25, 2026
25 checks passed
@JeremyDev87 JeremyDev87 deleted the fix/606-cursor-project-root-detection branch February 25, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working config Root config and rules documentation Improvements or additions to documentation mcp-server apps/mcp-server priority:should Should Have - 중요하지만 필수는 아님

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cursor] Project root auto-detection unreliable — CODINGBUDDY_PROJECT_ROOT must be explicitly set

1 participant