polydev-ai 1.8.5 → 1.8.7

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/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
@@ -826,7 +826,11 @@ class StdioMCPWrapper {
826
826
  if (successfulClis.length > 0) {
827
827
  // Show successful CLI responses
828
828
  for (const cliResult of successfulClis) {
829
- formatted += `🟢 **Local CLI Response** (${cliResult.provider_id} - ${cliResult.mode || 'args'} mode)\n\n`;
829
+ // Display actual model name if detected, otherwise show provider ID
830
+ const modelDisplay = cliResult.model_used && cliResult.model_used !== 'cli_default' && cliResult.model_used !== 'cli_default_fallback'
831
+ ? cliResult.model_used
832
+ : cliResult.provider_id;
833
+ formatted += `🟢 **Local CLI Response** (${modelDisplay})\n\n`;
830
834
  formatted += `${cliResult.content}\n\n`;
831
835
  formatted += `*Latency: ${cliResult.latency_ms || 0}ms | Tokens: ${cliResult.tokens_used || 0}*\n\n`;
832
836
  formatted += `---\n\n`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
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.7",
71
71
  "posthog-js": "^1.157.2",
72
72
  "prismjs": "^1.30.0",
73
73
  "react": "^18.3.1",