From 2ac00789600d7472a169981749189e5085cad1b3 Mon Sep 17 00:00:00 2001 From: Meleki Date: Wed, 1 Apr 2026 10:12:07 +0200 Subject: [PATCH] fix: Auto-Context SSE-Event und DB-Save auch im CLI-Codepfad Co-Authored-By: Claude Opus 4.6 --- Services/AnthropicService.Cli.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Services/AnthropicService.Cli.cs b/Services/AnthropicService.Cli.cs index 55a5e24..eaa4f7e 100644 --- a/Services/AnthropicService.Cli.cs +++ b/Services/AnthropicService.Cli.cs @@ -85,7 +85,17 @@ public partial class AnthropicService { var autoCtx = await BuildAutoContextAsync(messages, chainId, agentId); if (autoCtx != null) + { systemText.AppendLine(autoCtx); + await SseHelper.TryWriteSse(response, "auto_context", new { context = autoCtx }, sseCt); + await _db.SaveMessage(new MessageRecord + { + ChainId = chainId, + Role = "system", + Type = "auto_context", + Content = autoCtx + }); + } } catch (Exception ex) {