add project root diagnostic warning for Cursor#640
Merged
JeremyDev87 merged 3 commits intomasterfrom Feb 25, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
42ea20b to
373be34
Compare
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
Fixes unreliable project root auto-detection in Cursor environments where
roots/listMCP capability may not be supported, causingcodingbuddy.config.jsonto not be found and settings to fall back to defaults.Changes
ProjectRootSourcetype ('env' | 'roots_list' | 'auto_detect') andgetProjectRootSource()getter to track how the project root was resolvedsourceparameter tosetProjectRootAndReload()for caller-specific source trackingprojectRootWarningdiagnostic inparse_moderesponse when project root was auto-detected and nocodingbuddy.config.jsonwas foundCODINGBUDDY_PROJECT_ROOTas required env var with explanation of why it's neededCommits
feat(config): track project root resolution source— ProjectRootSource type, getProjectRootSource(), source tracking in findProjectRoot/setProjectRootAndReload (4 tests)feat(mcp): add projectRootWarning diagnostic to parse_mode— warning when auto_detect + config not loaded (4 tests)docs(cursor): add CODINGBUDDY_PROJECT_ROOT setup instructions— updated .cursor/mcp.json template and added explanation notestyle(config): format setProjectRootAndReload signature to multi-line— code style consistencyCloses #606
Test plan
getProjectRootSource()returns'env'whenCODINGBUDDY_PROJECT_ROOTis setgetProjectRootSource()returns'auto_detect'when no env var is setsetProjectRootAndReload()updates source to'roots_list'(default) or custom valueprojectRootWarningincluded only when source isauto_detectAND config not loadedprojectRootWarningNOT included when source isenvorroots_listprojectRootWarningNOT included whenauto_detectbut config is loaded