Skip to content

Commit 60c19d9

Browse files
glassBead-tcclaude
andcommitted
fix: address review feedback for agentic tests
1. Add API key validation with clear error message - Check for ANTHROPIC_API_KEY at start of main() - Provide helpful instructions if missing 2. Fix mental model name reference - Changed 'first_principles' to 'five-whys' - five-whys is a valid model in the codebase Addresses roomote review comments on PR #37. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8c9bdf4 commit 60c19d9

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

scripts/agentic-test.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const MENTAL_MODELS_TESTS = `
102102
- Should include at least 5 models
103103
104104
## Test 2: Get Specific Model
105-
**Action**: Call mental_models with operation "get_model", args { model: "first_principles" }
105+
**Action**: Call mental_models with operation "get_model", args { model: "five-whys" }
106106
**Expected**:
107107
- Returns detailed model information
108108
- Should include process steps or framework
@@ -257,6 +257,23 @@ async function runTestFromFile(filePath: string): Promise<TestResult> {
257257
// ============================================================================
258258

259259
async function main() {
260+
// Validate API key early with clear error message
261+
if (!process.env.ANTHROPIC_API_KEY) {
262+
console.error(`
263+
Error: ANTHROPIC_API_KEY environment variable is not set.
264+
265+
The agentic test runner uses the Claude Agent SDK which requires an Anthropic API key.
266+
267+
To fix this:
268+
1. Get an API key from https://console.anthropic.com/
269+
2. Set the environment variable:
270+
export ANTHROPIC_API_KEY="your-api-key-here"
271+
3. Or prefix the command:
272+
ANTHROPIC_API_KEY="your-key" npm test
273+
`);
274+
process.exit(1);
275+
}
276+
260277
const args = process.argv.slice(2);
261278

262279
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {

0 commit comments

Comments
 (0)