fix(openai): Auto-Context, Tool-Result-Matching, Payload-Preview, leere Bubbles

- Auto-Context (Embedding-Suche) für OpenAI-Provider aktiviert: BuildAutoContextAsync
  auf internal static refactored und in StreamChat + ChatNonStreaming integriert
- Tool-Results mit Role="tool" (OpenAI-Konvention) werden in BuildHistoryFromDb
  jetzt korrekt erkannt (vorher nur Role="user"/Anthropic)
- Payload-Preview zeigt für OpenAI-Provider echtes API-Format (function-Wrapper,
  tool_choice:"auto", max_tokens, stream_options, extra_body)
- Tool-Input (Argumente) wird im SSE tool_end-Event mitgesendet (fehlte im OpenAI-Pfad)
- Leere Bubbles durch Whitespace-only Text nach </think>-Extraktion behoben
  (Trim in DB-Save, BuildHistoryFromDb und Frontend-Guard)
- History-Toggle-Bug: var→const in for-Loop (Block-Scoping für Closures),
  tool_result-Matching per data-tool-call-id statt blindes letztes Element
- Non-Streaming max_tokens für MiniMax auf 32768 + extra_body.reasoning_split

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MelekiandClaude Opus 4.6 committed 2026-05-14 11:16:40 +02:00
1 parent ecddbe5f36
commit 1fe04025d3
9 files changed
+164 -42

No files matched your search

+1 -1
View File
@@ -95,7 +95,7 @@ builder.Services.AddSingleton<AnthropicService>(sp =>
// OpenAI-kompatibler Service (Nvidia etc.)
builder.Services.AddSingleton<OpenAiService>(sp =>
new OpenAiService(sp.GetRequiredService<IHttpClientFactory>(), dbService, sp.GetRequiredService<ToolService>(), serverSettings, dataDir));
new OpenAiService(sp.GetRequiredService<IHttpClientFactory>(), dbService, sp.GetRequiredService<ToolService>(), serverSettings, dataDir, vectorSearchService));
// Telegram Bot (pro Session – Token aus Session-Config)
builder.Services.AddSingleton<TelegramService>(sp =>