polydev-ai 1.8.11 → 1.8.13

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.
Files changed (2) hide show
  1. package/lib/cliManager.js +32 -13
  2. package/package.json +1 -1
package/lib/cliManager.js CHANGED
@@ -369,9 +369,22 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
369
369
  return false; // CLI is broken due to Node.js compatibility
370
370
  }
371
371
 
372
- return !authOutput.includes('not authenticated') &&
373
- !authOutput.includes('please login') &&
374
- (authOutput.includes('authenticated') || authOutput.includes('logged in'));
372
+ // Check for positive auth indicators
373
+ // Gemini CLI outputs "Loaded cached credentials" when authenticated
374
+ const hasCredentials = authOutput.toLowerCase().includes('cached credentials') ||
375
+ authOutput.toLowerCase().includes('loaded cached');
376
+ const hasAuth = authOutput.includes('authenticated') || authOutput.includes('logged in');
377
+
378
+ // Quota exhaustion still means authenticated (just rate limited)
379
+ const hasQuotaError = authOutput.includes('exhausted your daily quota') ||
380
+ authOutput.includes('quota');
381
+
382
+ // Not authenticated indicators
383
+ const notAuth = authOutput.includes('not authenticated') ||
384
+ authOutput.includes('please login') ||
385
+ authOutput.includes('authentication required');
386
+
387
+ return !notAuth && (hasCredentials || hasAuth || hasQuotaError);
375
388
 
376
389
  default:
377
390
  return authOutput.includes('authenticated') || authOutput.includes('logged in');
@@ -456,17 +469,20 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
456
469
  // executeCodexExec now returns { content, detectedModel, rawStdout, rawStderr }
457
470
  const content = result.content;
458
471
  const detectedModel = result.detectedModel;
472
+ const rawStdout = result.rawStdout || '';
473
+ const rawStderr = result.rawStderr || '';
459
474
 
460
- // Check if the response contains a model error
461
- const modelError = content && (
462
- content.includes('model is not supported') ||
463
- content.includes('model not found') ||
464
- content.includes('invalid model') ||
465
- content.includes("doesn't exist")
466
- );
475
+ // Check ALL outputs for model error - content, rawStdout, and rawStderr
476
+ const combinedOutput = `${content || ''} ${rawStdout} ${rawStderr}`.toLowerCase();
477
+ const modelError = combinedOutput.includes('model is not supported') ||
478
+ combinedOutput.includes('model not found') ||
479
+ combinedOutput.includes('invalid model') ||
480
+ combinedOutput.includes("doesn't exist") ||
481
+ combinedOutput.includes("model does not exist") ||
482
+ combinedOutput.includes("unknown model");
467
483
 
468
484
  if (modelError && modelToUse && attempts < maxAttempts) {
469
- console.log(`[Polydev CLI] Model '${modelToUse}' failed for Codex CLI, retrying with CLI default...`);
485
+ console.log(`[Polydev CLI] Model '${modelToUse}' failed for Codex CLI (detected in output), retrying with CLI default...`);
470
486
  modelToUse = null; // Retry without model flag
471
487
  continue;
472
488
  }
@@ -492,10 +508,13 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
492
508
  const errorMsg = error instanceof Error ? error.message : String(error);
493
509
 
494
510
  // Check if error is model-related and we can retry
495
- const isModelError = errorMsg.includes('model') && (
511
+ const isModelError = errorMsg.toLowerCase().includes('model') && (
496
512
  errorMsg.includes('not supported') ||
497
513
  errorMsg.includes('not found') ||
498
- errorMsg.includes('invalid')
514
+ errorMsg.includes('invalid') ||
515
+ errorMsg.includes("doesn't exist") ||
516
+ errorMsg.includes("does not exist") ||
517
+ errorMsg.includes("unknown")
499
518
  );
500
519
 
501
520
  if (isModelError && modelToUse && attempts < maxAttempts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.8.11",
3
+ "version": "1.8.13",
4
4
  "description": "Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
5
5
  "keywords": [
6
6
  "mcp",