polydev-ai 1.8.11 → 1.8.12

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 +16 -10
  2. package/package.json +1 -1
package/lib/cliManager.js CHANGED
@@ -456,17 +456,20 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
456
456
  // executeCodexExec now returns { content, detectedModel, rawStdout, rawStderr }
457
457
  const content = result.content;
458
458
  const detectedModel = result.detectedModel;
459
+ const rawStdout = result.rawStdout || '';
460
+ const rawStderr = result.rawStderr || '';
459
461
 
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
- );
462
+ // Check ALL outputs for model error - content, rawStdout, and rawStderr
463
+ const combinedOutput = `${content || ''} ${rawStdout} ${rawStderr}`.toLowerCase();
464
+ const modelError = combinedOutput.includes('model is not supported') ||
465
+ combinedOutput.includes('model not found') ||
466
+ combinedOutput.includes('invalid model') ||
467
+ combinedOutput.includes("doesn't exist") ||
468
+ combinedOutput.includes("model does not exist") ||
469
+ combinedOutput.includes("unknown model");
467
470
 
468
471
  if (modelError && modelToUse && attempts < maxAttempts) {
469
- console.log(`[Polydev CLI] Model '${modelToUse}' failed for Codex CLI, retrying with CLI default...`);
472
+ console.log(`[Polydev CLI] Model '${modelToUse}' failed for Codex CLI (detected in output), retrying with CLI default...`);
470
473
  modelToUse = null; // Retry without model flag
471
474
  continue;
472
475
  }
@@ -492,10 +495,13 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
492
495
  const errorMsg = error instanceof Error ? error.message : String(error);
493
496
 
494
497
  // Check if error is model-related and we can retry
495
- const isModelError = errorMsg.includes('model') && (
498
+ const isModelError = errorMsg.toLowerCase().includes('model') && (
496
499
  errorMsg.includes('not supported') ||
497
500
  errorMsg.includes('not found') ||
498
- errorMsg.includes('invalid')
501
+ errorMsg.includes('invalid') ||
502
+ errorMsg.includes("doesn't exist") ||
503
+ errorMsg.includes("does not exist") ||
504
+ errorMsg.includes("unknown")
499
505
  );
500
506
 
501
507
  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.12",
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",