Files
gott/Models/AgentRecord.cs
T
MelekiandClaude Opus 4.7 3f913f14b5 Add per-agent reasoning effort
Opus 4.5+ and Sonnet 4.6+ support a new "effort" knob that controls how
much budget the model spends on thinking and tool calls. Plumb it through
end to end so each agent can pick its own level.

Storage & shape:
- New TEXT column agents.effort (default '') added via TryAddColumn.
- AgentRecord.Effort + INSERT/UPDATE in DatabaseService.Agents.cs.
- ChatContext.Effort + SubAgentContext.Effort so the value travels with the
  request alongside model and tool settings.

Agent editor:
- Effort dropdown above git-commit behavior in the agent form (low/medium/
  high/xhigh/max plus empty = "use default"). Always visible; on OpenAI
  providers the value is sent but silently ignored.
- agent-page.js load/save and AgentEndpoint create/update wired up.

Anthropic API path:
- StreamChat and RunNonStreamingToolLoop add output_config: { effort } when
  effort is set and not "high" – empty/null/"high" means "omit and let the
  API pick its default".
- Sub-agents (preparer/review/finalizer) get the parameter through
  RunAgentChat so each step uses its own agent's effort.

Anthropic CLI path:
- ClaudeCliService.ChatStreamingAsync takes an effort parameter and exports
  CLAUDE_CODE_EFFORT_LEVEL on the spawned process. Env-var beats the
  --effort flag because it also covers "max" and "ultracode".
- StreamChatViaCli, ChatNonStreamingViaCli, RunSubAgentViaCli, and the
  ChatEndpoint anthropic branches all hand the value through.

ARCHITECTURE.md / ARCHITECTURE_QUICK.md updated with the new field.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-31 21:33:32 +02:00

42 lines
1.9 KiB
C#

namespace Gott.Models;
public class AgentRecord
{
public long Id { get; set; }
public string AgentId { get; set; }
public string Name { get; set; }
public string Avatar { get; set; } // base64 data url (512px)
public string AvatarSmall { get; set; } // base64 data url (256px, für Listen)
public string Description { get; set; }
public string Model { get; set; }
public string ToolChoice { get; set; } // "any" oder "auto"
public string CustomCommands { get; set; }
public string AutoCommit { get; set; } = ""; // "", "mention", "forbid"
public bool UseSoul { get; set; } = true;
public bool UseIdentity { get; set; } = true;
public bool UseUserInfo { get; set; } = true;
public bool UseMemory { get; set; } = true;
public bool UseAutoContext { get; set; } = true;
public bool UseGitHubSearch { get; set; }
public bool UseSerperSearch { get; set; }
public bool UseWebSearch { get; set; }
public string WebSearchVersion { get; set; } = "";
public bool AllowUserChoice { get; set; } = true;
public string TaskInstruction { get; set; }
/// <summary>
/// Reasoning-Effort-Level für Claude (Opus 4.5+, Sonnet 4.6+).
/// Werte: "" (= high, weglassen), "low", "medium", "high", "xhigh" (Opus 4.7+), "max" (Opus 4.6+, Sonnet 4.6).
/// API-Pfad: wird als output_config.effort gesendet. CLI-Pfad: wird via CLAUDE_CODE_EFFORT_LEVEL gesetzt.
/// Bei OpenAI-Providern (MiniMax/Nvidia/etc.) wird das Feld stillschweigend ignoriert.
/// </summary>
public string Effort { get; set; } = "";
public double AvatarScale { get; set; } = 1.0;
public double AvatarOffsetX { get; set; }
public double AvatarOffsetY { get; set; }
public string UserId { get; set; }
public bool IsPublic { get; set; }
public bool IsDeleted { get; set; }
public string CreatedAt { get; set; }
public string UpdatedAt { get; set; }
}