fix(core): migrate Gemini CLI contextFileName to context.fileName#35581
Open
animeshxd wants to merge 1 commit intonrwl:masterfrom
Open
fix(core): migrate Gemini CLI contextFileName to context.fileName#35581animeshxd wants to merge 1 commit intonrwl:masterfrom
animeshxd wants to merge 1 commit intonrwl:masterfrom
Conversation
Gemini CLI v0.3.0+ no longer supports the "contextFileName" key at the top level of settings. It has been replaced with a nested "context" object. This commit updates the `setup-ai-agents` generator and related utilities to: - Use the new `context.fileName` structure. - Automatically migrate existing `.gemini/settings.json` files to the new format. - Support reading `context.fileName` when it is provided as an array of strings.
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for nx-dev pending review.Visit the deploys page to approve it
|
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.
Current Behavior
Gemini CLI
v0.3.0and higher (google-gemini/gemini-cli#7244 ) no longer supports the top-level"contextFileName"key in.gemini/settings.json. Workspaces using thesetup-ai-agentsgenerator or the Nx Gemini integration write and readcontextFileNamein the old flat format, which is silently ignored by newer Gemini versions, causing the context file to not be picked up at all.Additionally,
context.fileNamecan be astring[]in the new API, but the existing code only handledstring, meaning multi-file configurations were not supported.Expected Behavior
setup-ai-agentsgenerator writes context configuration using the new nested format:contextFileNamekey found in.gemini/settings.jsonis automatically migrated tocontext.fileNamewhen the generator runs, without overwriting an already-setcontext.fileName.context.fileNameis astring[], the first entry is used as the primary file for writing agent rules.utils.tsresolves the context file path by preferringcontext.fileNameover the legacycontextFileName, with full support for bothstringandstring[]values..gemini/settings.jsonis updated to use the new format.Related Issue(s)
Fixes #