refactor: remove unused OPENAI_API_KEY and GOOGLE_API_KEY

Removed all references to OPENAI_API_KEY and GOOGLE_API_KEY since only
Claude (Anthropic) provider is implemented. These were placeholder references
for future providers that don't exist yet.

Changes:
- Removed OPENAI_API_KEY and GOOGLE_API_KEY from docker-compose.yml
- Removed from .env and .env.example files
- Updated setup/routes/store-api-key.ts to only support anthropic
- Updated setup/routes/delete-api-key.ts to only support anthropic
- Updated setup/routes/api-keys.ts to only return anthropic key status
- Updated models/routes/providers.ts to only list anthropic provider
- Updated auto-mode-service.ts error message to only reference ANTHROPIC_API_KEY

Backend test results: 653/653 passing 

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Test User
2025-12-20 17:49:44 -05:00
parent 3a0a2e3019
commit 0bcd52290b
7 changed files with 8 additions and 23 deletions

View File

@@ -41,13 +41,6 @@ PORT=3008
# Data directory for sessions and metadata # Data directory for sessions and metadata
DATA_DIR=./data DATA_DIR=./data
# ============================================
# OPTIONAL - Additional AI Providers
# ============================================
# Google API key (for future Gemini support)
GOOGLE_API_KEY=
# ============================================ # ============================================
# OPTIONAL - Terminal Access # OPTIONAL - Terminal Access
# ============================================ # ============================================

View File

@@ -17,10 +17,6 @@ export function createProvidersHandler() {
available: statuses.claude?.installed || false, available: statuses.claude?.installed || false,
hasApiKey: !!process.env.ANTHROPIC_API_KEY, hasApiKey: !!process.env.ANTHROPIC_API_KEY,
}, },
google: {
available: !!process.env.GOOGLE_API_KEY,
hasApiKey: !!process.env.GOOGLE_API_KEY,
},
}; };
res.json({ success: true, providers }); res.json({ success: true, providers });

View File

@@ -12,7 +12,6 @@ export function createApiKeysHandler() {
success: true, success: true,
hasAnthropicKey: hasAnthropicKey:
!!getApiKey("anthropic") || !!process.env.ANTHROPIC_API_KEY, !!getApiKey("anthropic") || !!process.env.ANTHROPIC_API_KEY,
hasGoogleKey: !!getApiKey("google") || !!process.env.GOOGLE_API_KEY,
}); });
} catch (error) { } catch (error) {
logError(error, "Get API keys failed"); logError(error, "Get API keys failed");

View File

@@ -64,15 +64,13 @@ export function createDeleteApiKeyHandler() {
// Map provider to env key name // Map provider to env key name
const envKeyMap: Record<string, string> = { const envKeyMap: Record<string, string> = {
anthropic: "ANTHROPIC_API_KEY", anthropic: "ANTHROPIC_API_KEY",
google: "GOOGLE_GENERATIVE_AI_API_KEY",
openai: "OPENAI_API_KEY",
}; };
const envKey = envKeyMap[provider]; const envKey = envKeyMap[provider];
if (!envKey) { if (!envKey) {
res.status(400).json({ res.status(400).json({
success: false, success: false,
error: `Unknown provider: ${provider}`, error: `Unknown provider: ${provider}. Only anthropic is supported.`,
}); });
return; return;
} }

View File

@@ -36,9 +36,12 @@ export function createStoreApiKeyHandler() {
process.env.ANTHROPIC_API_KEY = apiKey; process.env.ANTHROPIC_API_KEY = apiKey;
await persistApiKeyToEnv("ANTHROPIC_API_KEY", apiKey); await persistApiKeyToEnv("ANTHROPIC_API_KEY", apiKey);
logger.info("[Setup] Stored API key as ANTHROPIC_API_KEY"); logger.info("[Setup] Stored API key as ANTHROPIC_API_KEY");
} else if (provider === "google") { } else {
process.env.GOOGLE_API_KEY = apiKey; res.status(400).json({
await persistApiKeyToEnv("GOOGLE_API_KEY", apiKey); success: false,
error: `Unsupported provider: ${provider}. Only anthropic is supported.`,
});
return;
} }
res.json({ success: true }); res.json({ success: true });

View File

@@ -1945,7 +1945,7 @@ This mock response was generated because AUTOMAKER_MOCK_AGENT=true was set.
) { ) {
throw new Error( throw new Error(
"Authentication failed: Invalid or expired API key. " + "Authentication failed: Invalid or expired API key. " +
"Please check your ANTHROPIC_API_KEY or GOOGLE_API_KEY, or run 'claude login' to re-authenticate." "Please check your ANTHROPIC_API_KEY, or run 'claude login' to re-authenticate."
); );
} }

View File

@@ -48,10 +48,6 @@ services:
# Optional - CORS origin (default allows all) # Optional - CORS origin (default allows all)
- CORS_ORIGIN=${CORS_ORIGIN:-*} - CORS_ORIGIN=${CORS_ORIGIN:-*}
# Optional - additional API keys
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- GOOGLE_API_KEY=${GOOGLE_API_KEY:-}
volumes: volumes:
# ONLY named volumes - these are isolated from your host filesystem # ONLY named volumes - these are isolated from your host filesystem
# This volume persists data between restarts but is container-managed # This volume persists data between restarts but is container-managed