fix: backend toggle not sent to server; add per-message model tag
Fixes:
- app.js was tracking primaryBackend locally but never included
model: primaryBackend in the /chat POST body, so the server always
used settings.primary_backend regardless of what the user clicked.
Now model: primaryBackend is sent on every chat request.
- Responses were only annotated when fallback occurred. Now every
assistant message shows a small model tag at the bottom right.
chat.py:
- _backend_label() resolves human-readable name:
claude → "Claude", gemini → "Gemini",
local → registry label (e.g. "Gemma 4 E4B") or model_name
- SSE payload now includes backend_label field
app.js:
- model: primaryBackend added to /chat fetch body
- After every response, appends .model-tag div with backend_label
- Fallback shows "⚡ fallback → <label>" in amber; normal is muted
- Removed separate system message for fallback (tag covers it)
style.css:
- .model-tag: small muted text, right-aligned, separated by thin line
- .model-tag.fallback: amber (#f59e0b)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -552,6 +552,20 @@
|
||||
.copy-btn:hover { color: var(--text); border-color: var(--muted); }
|
||||
.copy-btn.copied { color: var(--success); border-color: var(--success-dim); }
|
||||
|
||||
/* Model tag — shown at the bottom of every assistant message */
|
||||
.model-tag {
|
||||
display: block;
|
||||
font-size: 0.67rem;
|
||||
color: #334155;
|
||||
margin-top: 0.55rem;
|
||||
padding-top: 0.4rem;
|
||||
border-top: 1px solid #1e2030;
|
||||
text-align: right;
|
||||
letter-spacing: 0.02em;
|
||||
font-weight: 500;
|
||||
}
|
||||
.model-tag.fallback { color: #f59e0b; }
|
||||
|
||||
/* Note messages */
|
||||
.message.note-private {
|
||||
align-self: flex-end;
|
||||
|
||||
Reference in New Issue
Block a user