Skip to content

Commit 6424a0a

Browse files
committed
rm faulty api key check
1 parent ff26675 commit 6424a0a

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

.changeset/grumpy-pumas-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"magnitude-test": patch
3+
---
4+
5+
fix faulty api key check

packages/magnitude-test/src/cli.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { TermAppRenderer } from '@/term-app'; // Import TermAppRenderer
2323
// Removed import { initializeUI, updateUI, cleanupUI } from '@/term-app';
2424
import { startWebServers, stopWebServers } from './webServer';
2525
import chalk from 'chalk';
26-
import os from 'os';
2726

2827
interface CliOptions {
2928
workers?: number;
@@ -197,30 +196,6 @@ program
197196

198197
//console.log(config)
199198

200-
// Check if any API key is set in environment variables or config file
201-
const hasApiKey = process.env.ANTHROPIC_API_KEY ||
202-
(config.llm && 'options' in config.llm && 'apiKey' in config.llm.options && config.llm.options.apiKey);
203-
204-
// Check if user is authenticated through Claude Code
205-
let hasClaudeCodeAuth = false;
206-
try {
207-
const CREDS_PATH = path.join(os.homedir(), '.magnitude', 'credentials', 'claudeCode.json');
208-
const data = await fs.promises.readFile(CREDS_PATH, 'utf-8');
209-
const creds = JSON.parse(data);
210-
hasClaudeCodeAuth = creds.expires_at > Date.now() + 60000;
211-
} catch (error) {
212-
hasClaudeCodeAuth = false;
213-
}
214-
215-
if (!hasApiKey && !hasClaudeCodeAuth) {
216-
console.error("Missing API key for LLM provider");
217-
console.error("You can either:");
218-
console.error(" - Set ANTHROPIC_API_KEY environment variable");
219-
console.error(" - Configure an API key in your magnitude.config.ts");
220-
console.error(" - Authenticate with Claude Code");
221-
process.exit(1);
222-
}
223-
224199
// // If planner not provided, make a choice based on available environment variables
225200
// if (!config.planner) {
226201
// const planner = tryDeriveEnvironmentPlannerClient();

0 commit comments

Comments
 (0)