fix: remove Model ID field from public models in admin
Public models are now display-only and don't require a Model ID: - Removed Model ID input field from admin.html public models section - Updated admin.js to not require or send Model ID for public models - Updated server API to accept public models without Model ID - Uses display label as the identifier for public models - Only requires Model ID for OpenCode models (which need it for execution) Public models are purely for user-facing display in the builder dropdown, while OpenCode models form the actual execution fallback chain.
This commit is contained in:
@@ -120,10 +120,6 @@
|
||||
</header>
|
||||
<p style="margin-top:0; color: var(--muted);">These models are displayed to users in the builder dropdown for selection. This is separate from the OpenCode fallback chain.</p>
|
||||
<form id="public-model-form" class="admin-form">
|
||||
<label>
|
||||
Model ID (e.g., claude-3-5-sonnet, gpt-4o)
|
||||
<input id="public-model-name" type="text" placeholder="Enter model ID manually" required />
|
||||
</label>
|
||||
<label>
|
||||
Display name shown to users
|
||||
<input id="public-model-label" type="text" placeholder="Friendly label (e.g., Claude 3.5 Sonnet)" required />
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
opencodeModelsCount: document.getElementById('opencode-models-count'),
|
||||
// Public Models (user-facing selection)
|
||||
publicModelForm: document.getElementById('public-model-form'),
|
||||
publicModelName: document.getElementById('public-model-name'),
|
||||
publicModelLabel: document.getElementById('public-model-label'),
|
||||
publicModelTier: document.getElementById('public-model-tier'),
|
||||
publicModelIcon: document.getElementById('public-model-icon'),
|
||||
@@ -2425,16 +2424,11 @@
|
||||
if (el.publicModelForm) {
|
||||
el.publicModelForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const name = el.publicModelName.value.trim();
|
||||
const label = el.publicModelLabel.value.trim();
|
||||
const icon = el.publicModelIcon ? el.publicModelIcon.value : '';
|
||||
const tier = el.publicModelTier ? el.publicModelTier.value : 'free';
|
||||
const supportsMedia = el.publicModelMedia ? el.publicModelMedia.checked : false;
|
||||
|
||||
if (!name) {
|
||||
setPublicModelStatus('Model ID is required.', true);
|
||||
return;
|
||||
}
|
||||
if (!label) {
|
||||
setPublicModelStatus('Display name is required.', true);
|
||||
return;
|
||||
@@ -2446,7 +2440,6 @@
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
type: 'public',
|
||||
name,
|
||||
label,
|
||||
icon,
|
||||
tier,
|
||||
@@ -2454,7 +2447,6 @@
|
||||
}),
|
||||
});
|
||||
setPublicModelStatus('Saved');
|
||||
el.publicModelName.value = '';
|
||||
el.publicModelLabel.value = '';
|
||||
await loadConfigured();
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user