CMP-241 Add credential prompts and feature flag check for AI Features#17
Open
jah-leanix wants to merge 4 commits intomainfrom
Open
CMP-241 Add credential prompts and feature flag check for AI Features#17jah-leanix wants to merge 4 commits intomainfrom
jah-leanix wants to merge 4 commits intomainfrom
Conversation
mal-leanix
requested changes
Feb 18, 2026
mal-leanix
left a comment
There was a problem hiding this comment.
Thoroughly tested locally, works nicely, file is included when ff is enabled, ignored when disabled ✅
Left two comments, one that we should include about the missed symlink CLAUDE.md, the other a nicer way to include the user, when we run into a problem.
Hope the comments make sense.
| } | ||
|
|
||
| // Check feature flag from LeanIX workspace | ||
| mcpCustomReportsEnabled = await checkFeatureFlag({ |
There was a problem hiding this comment.
What if we added some graceful failing here, because if this check fails, due to some network error, or any other reason, the scaffolding fails, and the user gets no feedback. We could include:
Suggested change
| mcpCustomReportsEnabled = await checkFeatureFlag({ | |
| try { | |
| mcpCustomReportsEnabled = await checkFeatureFlag({ | |
| host, | |
| tokenResponse, | |
| featureFlagId: 'mcpserver.custom-reports', | |
| proxyURL | |
| }); | |
| console.log(`✓ MCP custom reports ${mcpCustomReportsEnabled ? 'enabled' : 'disabled'} for this workspace`); | |
| } catch (error) { | |
| console.log(`${red('⚠')} Could not check feature flags: ${error instanceof Error ? error.message : 'Unknown error'}`); | |
| console.log('AGENTS.md will not be included in the generated project.\n'); | |
| mcpCustomReportsEnabled = false; | |
| } |
| const templateFiles = readdirSync(templateDir); | ||
| for (const file of templateFiles /* .filter(f => f !== 'package.json') */) { | ||
| // Skip AGENTS.md if MCP custom reports feature is not enabled | ||
| if (file === 'AGENTS.md' && !mcpCustomReportsEnabled) { |
There was a problem hiding this comment.
We might have to also include the symlink CLAUDE.md file here
Suggested change
| if (file === 'AGENTS.md' && !mcpCustomReportsEnabled) { | |
| if ((file === 'AGENTS.md' || file === 'CLAUDE.md') && !mcpCustomReportsEnabled) { |
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.
Introduce checks for credentials (host, API token, and proxy) during initialization.
Implement a feature flag check to determine if custom report mcp tools are enabled in the LeanIX workspace.
Conditionally deliver the AGENTS.md.