polydev-ai 1.8.5 → 1.8.6

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 +12 -8
  2. package/package.json +2 -2
package/lib/cliManager.js CHANGED
@@ -785,21 +785,25 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
785
785
  const content = json.result;
786
786
 
787
787
  // Extract primary model from modelUsage
788
- // Priority: Opus > Sonnet > Haiku (prefer larger models as they do the main reasoning)
788
+ // The primary model is the one with highest cost - that's the user's configured main model
789
+ // (Haiku is used internally for quick tasks, but the expensive model is what the user chose)
789
790
  let primaryModel = 'cli_default';
790
791
  const modelUsage = json.modelUsage || {};
791
792
  const modelNames = Object.keys(modelUsage);
792
793
 
793
794
  if (modelNames.length === 1) {
794
- // Only one model used
795
+ // Only one model used - that's the primary
795
796
  primaryModel = modelNames[0];
796
797
  } else if (modelNames.length > 1) {
797
- // Multiple models - prefer Opus > Sonnet > Haiku
798
- const opusModel = modelNames.find(m => m.includes('opus'));
799
- const sonnetModel = modelNames.find(m => m.includes('sonnet'));
800
- const haikuModel = modelNames.find(m => m.includes('haiku'));
801
-
802
- primaryModel = opusModel || sonnetModel || haikuModel || modelNames[0];
798
+ // Multiple models - the one with highest cost is the user's configured main model
799
+ let highestCost = -1;
800
+ for (const [modelName, usage] of Object.entries(modelUsage)) {
801
+ const cost = usage.costUSD || 0;
802
+ if (cost > highestCost) {
803
+ highestCost = cost;
804
+ primaryModel = modelName;
805
+ }
806
+ }
803
807
  }
804
808
 
805
809
  // Calculate total tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
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",
@@ -67,7 +67,7 @@
67
67
  "lucide-react": "^0.542.0",
68
68
  "marked": "^16.2.1",
69
69
  "next": "^15.5.7",
70
- "polydev-ai": "^1.8.4",
70
+ "polydev-ai": "^1.8.5",
71
71
  "posthog-js": "^1.157.2",
72
72
  "prismjs": "^1.30.0",
73
73
  "react": "^18.3.1",