-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Bug: --list-sessions ignores saved /auth state and strictly requires GEMINI_API_KEY env var #26906
Copy link
Copy link
Labels
area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent QualityIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityarea/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityarea/securityIssues related to securityIssues related to securityeffort/small1 day or less: trivial logic, UI adjustments, docs1 day or less: trivial logic, UI adjustments, docskind/bugpriority/p2Important but can be addressed in a future release.Important but can be addressed in a future release.status/bot-triagedstatus/manual-triage
Metadata
Metadata
Assignees
Labels
area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent QualityIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityarea/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityarea/securityIssues related to securityIssues related to securityeffort/small1 day or less: trivial logic, UI adjustments, docs1 day or less: trivial logic, UI adjustments, docskind/bugpriority/p2Important but can be addressed in a future release.Important but can be addressed in a future release.status/bot-triagedstatus/manual-triage
Type
Fields
Give feedbackNo fields configured for Bug.
Projects
Status
Closed
What happened?
When running the
gemini --list-sessionscommand, the CLI ignores the internally saved authentication state. If theGEMINI_API_KEYenvironment variable is not explicitly exported in the current shell, the command crashes.What did you expect to happen?
The
--list-sessionscommand should use the exact same authentication resolution logic as the maingeminicommand. It should recognize the saved internal/authstate, authenticate successfully without strictly requiring the environment variable, and correctly list the existing local sessions.Client information
CLI Version: 0.41.2
Git Commit: b0c7a17
Model: Auto (Gemini 3)
Sandbox: no sandbox
OS: darwin (macOS)
IDE Client: Antigravity
Login information
API Key
Anything else we need to know?
There appear to be two distinct issues happening simultaneously here:
--list-sessionsflag seems hardcoded to check only the environment variable or local.envfile, completely bypassing the internal config loader that standard commands use.No previous sessions found for this project.message prints prematurely. It checks for files, hits an auth failure, and assumes no files exist rather than waiting to catch and report the auth failure cleanly.