Modellname im Chat anzeigen + Opus 4 als Default

- ChatPanel: Zeigt Modellname statt "Claude" (z.B. "opus-4", "haiku-4-5")
- Modell-Info kommt aus dem result-Event der Bridge
- Korrekter Modell-ID: claude-opus-4-20250514

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Eddy 2026-04-13 21:21:40 +02:00
parent 87ccf014cc
commit 03f84ceb56
4 changed files with 14 additions and 9 deletions

View file

@ -34,7 +34,7 @@ let client = null;
let apiKey = null;
let conversationHistory = []; // Messages für Multi-Turn
let activeAbortController = null;
const MODEL = process.env.CLAUDE_MODEL || 'claude-opus-4-6-20250623';
const MODEL = process.env.CLAUDE_MODEL || 'claude-opus-4-20250514';
const SYSTEM_PROMPT = `Du bist Claude, ein hilfreicher KI-Assistent von Anthropic.
Du antwortest auf Deutsch. Du bist direkt, präzise und hilfreich.

View file

@ -71,7 +71,7 @@
{#if message.role === 'user'}
👤 Du
{:else if message.role === 'assistant'}
🤖 Claude
🤖 {#if message.model}{message.model.replace('claude-', '').replace(/-\d+$/, '')}{:else}Claude{/if}
{:else}
⚙️ System
{/if}

View file

@ -29,6 +29,7 @@ export interface Message {
content: string;
timestamp: Date;
agentId?: string;
model?: string;
}
export interface Permission {

View file

@ -42,6 +42,7 @@ interface ResultEvent {
output: number;
};
session_id?: string;
model?: string;
}
// Listener-Handles
@ -156,15 +157,18 @@ export async function initEventListeners(): Promise<void> {
})
);
// Ergebnis (Kosten, Token)
// Ergebnis (Kosten, Token, Modell)
listeners.push(
await listen<ResultEvent>('claude-result', (event) => {
const { cost, tokens, session_id } = event.payload;
console.log('📊 Ergebnis:', {
cost: cost ? `$${cost.toFixed(4)}` : 'unbekannt',
tokens,
session_id
});
const { cost, tokens, session_id, model } = event.payload;
console.log('📊 Ergebnis:', { cost: cost ? `$${cost.toFixed(4)}` : '-', tokens, model });
// Modell an die Streaming-Nachricht anhängen
if (model && streamingMessageId) {
messages.update((msgs) =>
msgs.map((m) => m.id === streamingMessageId ? { ...m, model } : m)
);
}
})
);