polydev-ai 1.8.21 → 1.8.22
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/mcp/stdio-wrapper.js +35 -9
- package/package.json +1 -1
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -770,7 +770,8 @@ class StdioMCPWrapper {
|
|
|
770
770
|
try {
|
|
771
771
|
const cliResults = localResults.map(result => ({
|
|
772
772
|
provider_id: result.provider_id,
|
|
773
|
-
|
|
773
|
+
// IMPORTANT: cliManager returns model_used, not model
|
|
774
|
+
model: result.model_used || result.model || this.getModelPreferenceForCli(result.provider_id),
|
|
774
775
|
content: result.content || '',
|
|
775
776
|
tokens_used: result.tokens_used || 0,
|
|
776
777
|
latency_ms: result.latency_ms || 0,
|
|
@@ -810,6 +811,37 @@ class StdioMCPWrapper {
|
|
|
810
811
|
}
|
|
811
812
|
}
|
|
812
813
|
|
|
814
|
+
/**
|
|
815
|
+
* Get model preference for a CLI provider from cached user preferences
|
|
816
|
+
* Falls back to a descriptive default if not available
|
|
817
|
+
*/
|
|
818
|
+
getModelPreferenceForCli(providerId) {
|
|
819
|
+
// Try to get from cached user model preferences first
|
|
820
|
+
if (this.userModelPreferences && this.userModelPreferences[providerId]) {
|
|
821
|
+
return this.userModelPreferences[providerId];
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// Map CLI provider to API provider for lookup
|
|
825
|
+
const cliToApiProvider = {
|
|
826
|
+
'claude_code': 'anthropic',
|
|
827
|
+
'codex_cli': 'openai',
|
|
828
|
+
'gemini_cli': 'google'
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
const apiProvider = cliToApiProvider[providerId];
|
|
832
|
+
if (apiProvider && this.userModelPreferences && this.userModelPreferences[apiProvider]) {
|
|
833
|
+
return this.userModelPreferences[apiProvider];
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
// Fallback to descriptive defaults based on typical CLI models
|
|
837
|
+
const defaults = {
|
|
838
|
+
'claude_code': 'claude-sonnet-4',
|
|
839
|
+
'codex_cli': 'gpt-4.1',
|
|
840
|
+
'gemini_cli': 'gemini-2.5-pro'
|
|
841
|
+
};
|
|
842
|
+
return defaults[providerId] || 'unknown';
|
|
843
|
+
}
|
|
844
|
+
|
|
813
845
|
/**
|
|
814
846
|
* Get default model name for a CLI tool (used when model not specified in result)
|
|
815
847
|
* These are just display labels - actual model selection is done by:
|
|
@@ -817,14 +849,8 @@ class StdioMCPWrapper {
|
|
|
817
849
|
* 2. CLI tool's own default if no preference set
|
|
818
850
|
*/
|
|
819
851
|
getDefaultModelForCli(providerId) {
|
|
820
|
-
//
|
|
821
|
-
|
|
822
|
-
const defaults = {
|
|
823
|
-
'claude_code': 'CLI Default',
|
|
824
|
-
'codex_cli': 'CLI Default',
|
|
825
|
-
'gemini_cli': 'CLI Default'
|
|
826
|
-
};
|
|
827
|
-
return defaults[providerId] || 'CLI Default';
|
|
852
|
+
// Prefer user's model preference if available
|
|
853
|
+
return this.getModelPreferenceForCli(providerId);
|
|
828
854
|
}
|
|
829
855
|
|
|
830
856
|
/**
|
package/package.json
CHANGED