diff --git a/Models/ChainRecord.cs b/Models/ChainRecord.cs index b8a15e5..f462331 100644 --- a/Models/ChainRecord.cs +++ b/Models/ChainRecord.cs @@ -20,5 +20,6 @@ public class ChainRecord public string ArchiveId { get; set; } public string StreamErrorInfo { get; set; } public bool PlanMode { get; set; } + public string Effort { get; set; } public string CreatedAt { get; set; } } diff --git a/Services/AnthropicService.Cli.cs b/Services/AnthropicService.Cli.cs index c1b8384..f7f865e 100644 --- a/Services/AnthropicService.Cli.cs +++ b/Services/AnthropicService.Cli.cs @@ -307,6 +307,7 @@ public partial class AnthropicService chainId, durationMs = sw.ElapsedMilliseconds, stopReason, + effort, viaCli = true }, sseCt); } @@ -323,6 +324,7 @@ public partial class AnthropicService chainId, durationMs = sw.ElapsedMilliseconds, stopReason = stoppedReason, + effort, viaCli = true }, CancellationToken.None); } @@ -352,6 +354,7 @@ public partial class AnthropicService chainId, durationMs = sw.ElapsedMilliseconds, stopReason = "error", + effort, viaCli = true }, sseCt); } diff --git a/Services/AnthropicService.Streaming.cs b/Services/AnthropicService.Streaming.cs index aa56e38..2e4a929 100644 --- a/Services/AnthropicService.Streaming.cs +++ b/Services/AnthropicService.Streaming.cs @@ -302,7 +302,8 @@ public partial class AnthropicService durationMs = sw.ElapsedMilliseconds, stopReason = finalStopReason, streamErrorInfo, - planMode + planMode, + effort }, sseCt); return; } @@ -346,7 +347,8 @@ public partial class AnthropicService chainId, durationMs = sw.ElapsedMilliseconds, stopReason = "stopped", - planMode + planMode, + effort }, CancellationToken.None); } catch (Exception) when (workCt.IsCancellationRequested || hardCt.IsCancellationRequested) @@ -367,7 +369,8 @@ public partial class AnthropicService chainId, durationMs = sw.ElapsedMilliseconds, stopReason = "stopped", - planMode + planMode, + effort }, CancellationToken.None); } catch (OperationCanceledException) diff --git a/Services/ChatService.cs b/Services/ChatService.cs index 1c7aabd..cb7887e 100644 --- a/Services/ChatService.cs +++ b/Services/ChatService.cs @@ -120,7 +120,8 @@ public class ChatService SystemPrompt = systemPromptText, ToolChoice = toolChoice, ToolNames = toolNames, - PlanMode = planMode + PlanMode = planMode, + Effort = OpenAiService.IsOpenAiProvider(modelId) ? "" : agent.Effort }); await _db.UpdateSessionTimestamp(sessionId); diff --git a/Services/DatabaseService.Sessions.cs b/Services/DatabaseService.Sessions.cs index 080d657..52154ae 100644 --- a/Services/DatabaseService.Sessions.cs +++ b/Services/DatabaseService.Sessions.cs @@ -220,8 +220,8 @@ public partial class DatabaseService using var conn = CreateConnection(); chain.CreatedAt = DateTime.UtcNow.ToString("o"); await conn.ExecuteAsync(@" - INSERT INTO chains (chain_id, session_id, archive_id, agent_id, model, system_prompt, tool_choice, tool_names, input_tokens, output_tokens, iterations, stop_reason, duration_ms, plan_mode, created_at) - VALUES (@ChainId, @SessionId, @ArchiveId, @AgentId, @Model, @SystemPrompt, @ToolChoice, @ToolNames, @InputTokens, @OutputTokens, @Iterations, @StopReason, @DurationMs, @PlanMode, @CreatedAt) + INSERT INTO chains (chain_id, session_id, archive_id, agent_id, model, system_prompt, tool_choice, tool_names, input_tokens, output_tokens, iterations, stop_reason, duration_ms, plan_mode, effort, created_at) + VALUES (@ChainId, @SessionId, @ArchiveId, @AgentId, @Model, @SystemPrompt, @ToolChoice, @ToolNames, @InputTokens, @OutputTokens, @Iterations, @StopReason, @DurationMs, @PlanMode, @Effort, @CreatedAt) ", chain); } diff --git a/Services/DatabaseService.cs b/Services/DatabaseService.cs index 027efe3..0c06b67 100644 --- a/Services/DatabaseService.cs +++ b/Services/DatabaseService.cs @@ -197,6 +197,7 @@ public partial class DatabaseService TryAddColumn(conn, "sessions", "unity_mcp_token", "TEXT"); TryAddColumn(conn, "messages", "tag", "TEXT"); TryAddColumn(conn, "agents", "effort", "TEXT NOT NULL DEFAULT ''"); + TryAddColumn(conn, "chains", "effort", "TEXT NOT NULL DEFAULT ''"); // Migration: 1M-Suffix entfernen (Mai 2026). Seit März 2026 ist 1M-Context Default // bei Opus 4.6/4.7/4.8 + Sonnet 4.6 – kein "[1m]"-Suffix mehr nötig. diff --git a/wwwroot/js/chat.js b/wwwroot/js/chat.js index 05354d6..89f599c 100644 --- a/wwwroot/js/chat.js +++ b/wwwroot/js/chat.js @@ -4,6 +4,7 @@ function buildMetaBadges(d) { const badges = []; if (d.planMode) badges.push('📋 Plan-Modus'); badges.push(prettyModelName(d.model)); + if (d.effort) badges.push('Effort: ' + d.effort); badges.push('Tokens: ' + (d.inputTokens || 0) + ' / ' + (d.outputTokens || 0)); if (d.cacheCreationTokens > 0 || d.cacheReadTokens > 0) { badges.push('Cache: ' + (d.cacheReadTokens || 0) + ' / ' + (d.cacheCreationTokens || 0));