@iservu-inc/adf-cli 0.4.25 → 0.4.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,40 @@ All notable changes to `@iservu-inc/adf-cli` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.26] - 2025-10-04
9
+
10
+ ### šŸ”§ Improved Error Handling
11
+
12
+ **Enhanced: AI Model Selection Error Messages**
13
+ - **Problem:** When model selection fails (e.g., OpenRouter free models, unavailable models), error messages were not helpful
14
+ - **Solution:** Added comprehensive error detection and helpful guidance for common issues
15
+ - **Improvements:**
16
+ - **Privacy/Data Policy Errors:** Specific guidance for OpenRouter free models requiring privacy settings
17
+ - **404/Not Found Errors:** Clear explanation when models are unavailable or require specific endpoints
18
+ - **400/Parameter Errors:** Help for models using different API parameters (e.g., experimental models)
19
+ - **401/Invalid Key:** API key validation guidance
20
+ - **429/Rate Limit:** Rate limit detection with retry suggestion
21
+ - **Generic Fallback:** Helpful tip for unknown errors
22
+
23
+ **Added: OpenRouter Model Recommendations**
24
+ - Shows recommended models when 50+ models are available
25
+ - Warns users about free model privacy requirements
26
+ - Suggests most compatible models:
27
+ - anthropic/claude-sonnet-4-5
28
+ - openai/gpt-4-turbo
29
+ - google/gemini-pro-1.5
30
+
31
+ **Technical Details:**
32
+ - `ai-config.js:330-366`: Enhanced error handling with category detection
33
+ - `ai-config.js:282-288`: Added model recommendation tip for OpenRouter
34
+ - Error messages now provide actionable solutions, not just error text
35
+ - All 120 tests passing
36
+
37
+ **Impact:**
38
+ - Users get clear guidance when model selection fails
39
+ - Reduces confusion about privacy settings and model availability
40
+ - Faster troubleshooting with specific solutions
41
+
8
42
  ## [0.4.25] - 2025-10-04
9
43
 
10
44
  ### šŸ”§ UX Improvements
@@ -278,6 +278,15 @@ async function configureAIProvider(projectPath = process.cwd()) {
278
278
  // Fetch available models
279
279
  const availableModels = await fetchAvailableModels(selectedProvider, apiKey);
280
280
 
281
+ // Show helpful tip about model selection
282
+ if (selectedProvider.id === 'openrouter' && availableModels.length > 50) {
283
+ console.log(chalk.gray('\nšŸ’” Tip: Recommended models for best compatibility:'));
284
+ console.log(chalk.gray(' • anthropic/claude-sonnet-4-5'));
285
+ console.log(chalk.gray(' • openai/gpt-4-turbo'));
286
+ console.log(chalk.gray(' • google/gemini-pro-1.5'));
287
+ console.log(chalk.yellow(' āš ļø Free models may require specific privacy settings\n'));
288
+ }
289
+
281
290
  // Model selection with autocomplete
282
291
  console.log('');
283
292
  const { model } = await inquirer.prompt([
@@ -327,6 +336,44 @@ async function configureAIProvider(projectPath = process.cwd()) {
327
336
  spinner.fail(chalk.red('AI connection failed'));
328
337
  console.log(chalk.red(`\nError: ${error.message}\n`));
329
338
 
339
+ // Provide specific guidance for common errors
340
+ const errorMsg = error.message.toLowerCase();
341
+
342
+ if (errorMsg.includes('data policy') || errorMsg.includes('privacy')) {
343
+ console.log(chalk.yellow('šŸ“‹ Privacy/Data Policy Issue:\n'));
344
+ if (selectedProvider.id === 'openrouter') {
345
+ console.log(chalk.gray(' OpenRouter: Free models require specific privacy settings.'));
346
+ console.log(chalk.cyan(' Solutions:'));
347
+ console.log(chalk.gray(' 1. Configure privacy: https://openrouter.ai/settings/privacy'));
348
+ console.log(chalk.gray(' 2. Select a paid model instead (recommended)'));
349
+ console.log(chalk.gray(' 3. Enable "Free model publication" in settings\n'));
350
+ } else {
351
+ console.log(chalk.gray(' The selected model may require specific account settings.'));
352
+ console.log(chalk.gray(' Try selecting a different model or check your provider settings.\n'));
353
+ }
354
+ } else if (errorMsg.includes('404') || errorMsg.includes('not found') || errorMsg.includes('no endpoints')) {
355
+ console.log(chalk.yellow('šŸ“‹ Model Not Available:\n'));
356
+ console.log(chalk.gray(' The selected model may no longer be available or accessible.'));
357
+ console.log(chalk.cyan(' Solutions:'));
358
+ console.log(chalk.gray(' 1. Select a different, more widely supported model'));
359
+ console.log(chalk.gray(' 2. Check the provider\'s model availability'));
360
+ console.log(chalk.gray(' 3. Some models require specific API endpoints or settings\n'));
361
+ } else if (errorMsg.includes('400') || errorMsg.includes('unsupported parameter')) {
362
+ console.log(chalk.yellow('šŸ“‹ Model Parameter Incompatibility:\n'));
363
+ console.log(chalk.gray(' The selected model may use different API parameters.'));
364
+ console.log(chalk.cyan(' Solutions:'));
365
+ console.log(chalk.gray(' 1. Try a more standard model (e.g., gpt-4-turbo, claude-3-5-sonnet)'));
366
+ console.log(chalk.gray(' 2. Some newer/experimental models may not be fully supported yet\n'));
367
+ } else if (errorMsg.includes('401') || errorMsg.includes('invalid') || errorMsg.includes('unauthorized')) {
368
+ console.log(chalk.yellow('šŸ“‹ Invalid API Key:\n'));
369
+ console.log(chalk.gray(' Please check that your API key is correct and active.\n'));
370
+ } else if (errorMsg.includes('429') || errorMsg.includes('rate limit')) {
371
+ console.log(chalk.yellow('šŸ“‹ Rate Limit:\n'));
372
+ console.log(chalk.gray(' You\'ve hit the API rate limit. Please wait a moment and try again.\n'));
373
+ } else {
374
+ console.log(chalk.yellow('šŸ’” Tip: Try selecting a more widely supported model\n'));
375
+ }
376
+
330
377
  const { retry } = await inquirer.prompt([
331
378
  {
332
379
  type: 'confirm',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservu-inc/adf-cli",
3
- "version": "0.4.25",
3
+ "version": "0.4.26",
4
4
  "description": "CLI tool for AgentDevFramework - AI-assisted development framework with multi-provider AI support",
5
5
  "main": "index.js",
6
6
  "bin": {