fix: block insert env param to gemini(eg: gemini_api_key form json co…#283
Open
Next2012 wants to merge 1 commit intotiann:mainfrom
Open
fix: block insert env param to gemini(eg: gemini_api_key form json co…#283Next2012 wants to merge 1 commit intotiann:mainfrom
Next2012 wants to merge 1 commit intotiann:mainfrom
Conversation
…nfig), which will cause google auth account tigger using limit
| cwd?: string; | ||
| }): NodeJS.ProcessEnv { | ||
| const env: NodeJS.ProcessEnv = { | ||
| return { |
There was a problem hiding this comment.
[MAJOR] buildGeminiEnv now ignores hookSettingsPath and cwd, so the ACP Gemini process no longer receives GEMINI_CLI_SYSTEM_SETTINGS_PATH or GEMINI_PROJECT_DIR. That disables hook server config and can put remote sessions in the wrong project context (ACP spawn has no cwd). Evidence: cli/src/gemini/utils/config.ts:104-112.
Suggested fix:
export function buildGeminiEnv(opts: {
model?: string;
token?: string;
hookSettingsPath?: string;
cwd?: string;
}): NodeJS.ProcessEnv {
const env: NodeJS.ProcessEnv = { ...process.env };
if (opts.hookSettingsPath) {
env.GEMINI_CLI_SYSTEM_SETTINGS_PATH = opts.hookSettingsPath;
}
if (opts.cwd) {
env.GEMINI_PROJECT_DIR = opts.cwd;
}
return env;
}
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.
GeminiCLI can automatically obtain authorization, whether by retrieving the API_KEY from environment variables or by logging in with a Google account. This statement indicates that the extracted GEMINI_API_KEY will override the normal account login, thereby significantly reducing the quota of paid versions (such as Google AI Pro).