You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two dotenv readers include inline comments in unquoted values, against dotenv behavior:
GetEnvFile (internal/edit/env.go): GEMINI_API_KEY=abc123 # my key reads back as "abc123 # my key", so the comment becomes part of the key the agent setup writes and re-reads.
envFileValue (internal/provider/google.go): GOOGLE_CLOUD_PROJECT=my-project-123 # work reads back as "my-project-123 # work", pointing the Code Assist login at a project that does not exist.
For unquoted values, cut the value at the first '#' and trim trailing whitespace, as dotenv specifies. Quoted values are untouched, so a '#' inside single or double quotes is preserved.
Thanks, agreed. Pushed 50201cd: envFileValue in internal/provider/google.go now calls edit.GetEnvFile, so both readers share one parser. Added Google regression cases for a double-quoted value followed by a comment (GOOGLE_CLOUD_PROJECT="my-proj" # work) and a single-quoted value containing # followed by a comment (K='a#b' # c). Both fail on the previous head and pass now. internal/edit and the Google/env provider tests pass; I have not run the whole internal/provider suite to green.
Thanks for the update — verified 50201cd on current main: envFileValue now shares edit.GetEnvFile, the quoted+comment cases read right, and the new tests fail before / pass after. I also compared GetEnvFile with Gemini CLI's own dotenv parser (0.62) over a set of comment/quote lines and they now agree, and in a sandbox a route-to-magpie-and-back no longer bakes # my key into GEMINI_API_KEY. Full test chain passes. Merging.
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
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.
Two dotenv readers include inline comments in unquoted values, against dotenv behavior:
For unquoted values, cut the value at the first '#' and trim trailing whitespace, as dotenv specifies. Quoted values are untouched, so a '#' inside single or double quotes is preserved.