Skip to content

refactor(@angular/cli): add type safety fallbacks and deduplicate search roots for MCP projects tool#32882

Closed
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix/mcp-projects-validation-and-opt
Closed

refactor(@angular/cli): add type safety fallbacks and deduplicate search roots for MCP projects tool#32882
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix/mcp-projects-validation-and-opt

Conversation

@clydin

@clydin clydin commented Mar 27, 2026

Copy link
Copy Markdown
Member

Added runtime type checks for projectType and prefix to prevent unhandled schema exceptions. Implemented deduplicateSearchRoots to filter out child directories from overlapping search trees, optimizing filesystem scans. Aggregated validation errors and reported them in the tool output for better visibility.

@clydin clydin added the target: minor This PR is targeted for the next minor release label Mar 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces validation for project configuration elements (projectType, prefix, and builder) within the Angular MCP tool. It adds a validationErrors field to the output schema to report malformed or invalid schema elements. Additionally, a new utility function deduplicateSearchRoots was implemented to prevent redundant processing of overlapping search paths. Feedback was provided to refine the projectType validation check to ensure all non-undefined values are correctly validated, maintaining consistency with other property checks.

Comment thread packages/angular/cli/src/commands/mcp/tools/projects.ts Outdated
@clydin
clydin force-pushed the fix/mcp-projects-validation-and-opt branch 3 times, most recently from 76c30b8 to e00d403 Compare March 27, 2026 18:12
…rch roots for MCP projects tool

Added runtime type checks for `projectType` and `prefix` to prevent unhandled schema exceptions.
Implemented `deduplicateSearchRoots` to filter out child directories from overlapping search trees, optimizing filesystem scans.
Aggregated validation errors and reported them in the tool output for better visibility.
@clydin
clydin force-pushed the fix/mcp-projects-validation-and-opt branch from e00d403 to ebbb01d Compare March 27, 2026 18:33
@clydin clydin closed this Mar 27, 2026
@clydin
clydin deleted the fix/mcp-projects-validation-and-opt branch March 27, 2026 19:06
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant