-
Notifications
You must be signed in to change notification settings - Fork 290
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
On the first startup, Cipher correctly recognizes the GEMINI_API_KEY and Gemini works as expected. However, on subsequent startups, Cipher fails to detect the Gemini API key and displays an error requesting other API keys.
Steps to Reproduce
- Set the GEMINI_API_KEY environment variable.
- Start Cipher for the first time — Gemini is recognized and works.
- Stop and restart Cipher.
- Observe that Cipher now displays an error: "No API key or Ollama configuration found..." and does not recognize the GEMINI_API_KEY.
Expected Behavior
Cipher should consistently read the GEMINI_API_KEY and allow Gemini to be used as a provider on every startup, not just the first time.
Actual Behavior
Cipher only recognizes the GEMINI_API_KEY on the first run. On subsequent runs, it fails to detect the key and blocks startup with an error.
Screenshots
N/A (error occurs in the command line).
Environment Information
- OS: macOS Sequoia 15.6.1
- Version: cipher 0.3.0
- Node.js version: 23.11.0
Logs and Error Messages
10:14:00 ERROR: No API key or Ollama configuration found, please set at least one of OPENAI_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY, OLLAMA_BASE_URL, or AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION) in your environment variables
Available providers: OpenAI, Anthropic, OpenRouter, Ollama, Qwen, Gemini, Azure, AWS, LM Studio
Additional Context
The GEMINI_API_KEY is set and unchanged between runs. The issue only occurs after the first startup.
Possible Solution
- Investigate caching or state persistence that may affect API key detection after the first run.
- Ensure GEMINI_API_KEY is checked on every startup.
- Update documentation or code to clarify/reinforce correct provider initialization.
Checklist
- Searched for similar issues
- Provided all required information
- Tested on the latest version
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working