agentaudit 3.9.23 → 3.9.24
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/cli.mjs +11 -4
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -52,11 +52,18 @@ function resolveProvider(flagOverride, keys) {
|
|
|
52
52
|
return p;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
// Smart inference: if model
|
|
56
|
-
// → auto-select OpenRouter (which uses that format)
|
|
55
|
+
// Smart inference: if model is set, try to match it to a provider
|
|
57
56
|
const activeModel = globalModelOverride || process.env.AGENTAUDIT_MODEL || loadConfig()?.preferred_model;
|
|
58
|
-
if (activeModel
|
|
59
|
-
|
|
57
|
+
if (activeModel) {
|
|
58
|
+
const lm = activeModel.toLowerCase();
|
|
59
|
+
// Direct provider models (no slash = native format)
|
|
60
|
+
if (!lm.includes('/')) {
|
|
61
|
+
if (lm.startsWith('claude') && providers.anthropic) return providers.anthropic;
|
|
62
|
+
if ((lm.startsWith('gpt') || lm.startsWith('o3') || lm.startsWith('o4') || lm.startsWith('o1')) && providers.openai) return providers.openai;
|
|
63
|
+
if (providers.ollama && (process.env.OLLAMA_MODEL || process.env.OLLAMA_HOST)) return providers.ollama;
|
|
64
|
+
}
|
|
65
|
+
// Slash format = OpenRouter convention (provider/model)
|
|
66
|
+
if (lm.includes('/') && providers.openrouter) return providers.openrouter;
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
// Auto-detect priority: Anthropic > OpenAI > OpenRouter > Custom > Ollama (local last — usually weaker)
|