Add Cohere as a provider for build messages in admin panel

- Add 'cohere' to DEFAULT_PROVIDERS and PLANNING_PROVIDERS arrays in admin.js
- Add Cohere option to provider limits dropdown in admin.html
- Add 'cohere' to DEFAULT_PROVIDER_SEEDS, PLANNING_PROVIDERS, and KNOWN_USAGE_PROVIDERS in server.js

Cohere was already integrated in the opencode backend (SDK installed, provider registered, icons defined). These changes make it available in the admin panel for build message configuration.
This commit is contained in:
southseact-3d
2026-02-11 13:25:16 +00:00
parent 71c1677932
commit 5d91c86f90
3 changed files with 6 additions and 5 deletions

View File

@@ -193,6 +193,7 @@
<option value="cerebras">Cerebras</option> <option value="cerebras">Cerebras</option>
<option value="ollama">Ollama</option> <option value="ollama">Ollama</option>
<option value="opencode">OpenCode</option> <option value="opencode">OpenCode</option>
<option value="cohere">Cohere</option>
</select> </select>
</label> </label>
<label> <label>

View File

@@ -1,6 +1,6 @@
(() => { (() => {
const DEFAULT_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', 'opencode']; const DEFAULT_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', 'opencode', 'cohere'];
const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama']; const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', 'cohere'];
const pageType = document?.body?.dataset?.page || 'build'; const pageType = document?.body?.dataset?.page || 'build';
console.log('Admin JS loaded, pageType:', pageType); console.log('Admin JS loaded, pageType:', pageType);
const state = { const state = {

View File

@@ -522,7 +522,7 @@ const PLAN_PRICES = {
}; };
const AUTO_MODEL_TOKEN = 'auto'; const AUTO_MODEL_TOKEN = 'auto';
const DEFAULT_PROVIDER_FALLBACK = 'opencode'; const DEFAULT_PROVIDER_FALLBACK = 'opencode';
const DEFAULT_PROVIDER_SEEDS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', DEFAULT_PROVIDER_FALLBACK]; const DEFAULT_PROVIDER_SEEDS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', DEFAULT_PROVIDER_FALLBACK, 'cohere'];
const PROVIDER_PERSIST_DEBOUNCE_MS = 200; const PROVIDER_PERSIST_DEBOUNCE_MS = 200;
const TOKEN_ESTIMATION_BUFFER = 400; const TOKEN_ESTIMATION_BUFFER = 400;
const BOOST_PACK_SIZE = 500_000; const BOOST_PACK_SIZE = 500_000;
@@ -1546,7 +1546,7 @@ let mistralSettings = {
backupModel2: MISTRAL_MODEL_BACKUP_2, backupModel2: MISTRAL_MODEL_BACKUP_2,
backupModel3: MISTRAL_MODEL_BACKUP_3, backupModel3: MISTRAL_MODEL_BACKUP_3,
}; };
const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'ollama']; const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'ollama', 'cohere'];
let planSettings = { let planSettings = {
provider: 'openrouter', // legacy field, retained for backwards compatibility provider: 'openrouter', // legacy field, retained for backwards compatibility
freePlanModel: '', freePlanModel: '',
@@ -5892,7 +5892,7 @@ function normalizeProviderName(name) {
return (name || '').toString().trim().toLowerCase() || 'opencode'; return (name || '').toString().trim().toLowerCase() || 'opencode';
} }
const KNOWN_USAGE_PROVIDERS = new Set(['openrouter', 'mistral', 'opencode', 'google', 'groq', 'nvidia']); const KNOWN_USAGE_PROVIDERS = new Set(['openrouter', 'mistral', 'opencode', 'google', 'groq', 'nvidia', 'cohere']);
// Treat unknown "provider" labels that are really OpenRouter model families (e.g. openai/anthropic) // Treat unknown "provider" labels that are really OpenRouter model families (e.g. openai/anthropic)
// as OpenRouter for usage + rate-limits, so admin charts roll up correctly. // as OpenRouter for usage + rate-limits, so admin charts roll up correctly.