polydev-ai 1.9.6 → 1.9.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 +11 -4
- package/mcp/stdio-wrapper.js +3 -3
- package/package.json +1 -1
package/lib/cliManager.js
CHANGED
|
@@ -16,6 +16,13 @@ try {
|
|
|
16
16
|
|
|
17
17
|
const execAsync = promisify(exec);
|
|
18
18
|
|
|
19
|
+
// Known default models for each CLI tool (used when detection fails)
|
|
20
|
+
const CLI_DEFAULT_MODELS = {
|
|
21
|
+
'claude_code': 'claude-sonnet-4-5-20250929',
|
|
22
|
+
'gemini_cli': 'gemini-2.5-flash',
|
|
23
|
+
'codex_cli': 'o4-mini'
|
|
24
|
+
};
|
|
25
|
+
|
|
19
26
|
class CLIManager {
|
|
20
27
|
constructor(options = {}) {
|
|
21
28
|
this.providers = new Map();
|
|
@@ -548,7 +555,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
548
555
|
}
|
|
549
556
|
|
|
550
557
|
// Use detected model if available, otherwise fall back to what was requested or 'cli_default'
|
|
551
|
-
const actualModel = detectedModel || modelToUse || 'cli_default';
|
|
558
|
+
const actualModel = detectedModel || modelToUse || CLI_DEFAULT_MODELS[providerId] || 'cli_default';
|
|
552
559
|
|
|
553
560
|
if (detectedModel && detectedModel !== model) {
|
|
554
561
|
console.log(`[Polydev CLI] Codex CLI detected model: ${detectedModel} (requested: ${model || 'none'})`);
|
|
@@ -685,7 +692,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
685
692
|
|
|
686
693
|
// Detect actual model from CLI output
|
|
687
694
|
const detectedModel = this.detectModelFromOutput(providerId, result.stdout || '', result.stderr || '');
|
|
688
|
-
const actualModel = detectedModel || model || 'cli_default';
|
|
695
|
+
const actualModel = detectedModel || model || CLI_DEFAULT_MODELS[providerId] || 'cli_default';
|
|
689
696
|
|
|
690
697
|
if (detectedModel && detectedModel !== model) {
|
|
691
698
|
console.log(`[Polydev CLI] ${providerId} detected model: ${detectedModel} (requested: ${model || 'none'})`);
|
|
@@ -741,7 +748,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
741
748
|
|
|
742
749
|
// Detect actual model from fallback output
|
|
743
750
|
const detectedModel = this.detectModelFromOutput(providerId, fallbackResult.stdout || '', fallbackResult.stderr || '');
|
|
744
|
-
const actualModel = detectedModel || '
|
|
751
|
+
const actualModel = detectedModel || CLI_DEFAULT_MODELS[providerId] || 'cli_default';
|
|
745
752
|
|
|
746
753
|
if (detectedModel) {
|
|
747
754
|
console.log(`[Polydev CLI] ${providerId} fallback detected model: ${detectedModel}`);
|
|
@@ -1020,7 +1027,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
1020
1027
|
// Extract primary model from modelUsage
|
|
1021
1028
|
// The primary model is the one with highest cost - that's the user's configured main model
|
|
1022
1029
|
// (Haiku is used internally for quick tasks, but the expensive model is what the user chose)
|
|
1023
|
-
let primaryModel = 'cli_default';
|
|
1030
|
+
let primaryModel = CLI_DEFAULT_MODELS['claude_code'] || 'cli_default';
|
|
1024
1031
|
const modelUsage = json.modelUsage || {};
|
|
1025
1032
|
const modelNames = Object.keys(modelUsage);
|
|
1026
1033
|
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -1825,9 +1825,9 @@ Error: ${error.message}`
|
|
|
1825
1825
|
|
|
1826
1826
|
// Fallback to descriptive defaults based on typical CLI models
|
|
1827
1827
|
const defaults = {
|
|
1828
|
-
'claude_code': 'claude-sonnet-4',
|
|
1829
|
-
'codex_cli': '
|
|
1830
|
-
'gemini_cli': 'gemini-2.5-
|
|
1828
|
+
'claude_code': 'claude-sonnet-4-5-20250929',
|
|
1829
|
+
'codex_cli': 'o4-mini',
|
|
1830
|
+
'gemini_cli': 'gemini-2.5-flash'
|
|
1831
1831
|
};
|
|
1832
1832
|
return defaults[providerId] || 'unknown';
|
|
1833
1833
|
}
|