Remove tool_choice agent option - auto-detect based on workspace/skills/memory
- Remove tool_choice from AgentEndpoint (create, update, list responses) - ChatService: automatically set tool_choice='any' when workspace, memory or skills present, null otherwise. Same for preparer/review/finalizer - SystemPromptBuilder: remove 3 toolAny-conditional prompt blocks (KRITISCH, Verhalten, ERINNERUNG) - Frontend: remove checkbox, badge and JS references - Agent.ToolChoice DB field preserved for backward compat, no longer read
This commit is contained in:
1 parent
677b227200
commit
83945689a6
6 files changed
+10
-55
No files matched your search
@@ -51,22 +51,9 @@ public static class SystemPromptBuilder
|
||||
blocks.Add(new PromptBlock { Icon = "fa-user", Label = "User · Persona (UseUserInfo)", Content = $"## Dein Gegenüber\nDie folgende Beschreibung stammt von der Person, die dir gerade schreibt:\n\n{userPersona}" });
|
||||
}
|
||||
|
||||
bool toolAny = string.Equals(agent.ToolChoice, "any", System.StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
var effectiveWorkspace = resolvedWorkspace ?? session.Workspace;
|
||||
if (!string.IsNullOrWhiteSpace(effectiveWorkspace))
|
||||
{
|
||||
if (toolAny && !planMode)
|
||||
{
|
||||
blocks.Add(new PromptBlock
|
||||
{
|
||||
Icon = "fa-exclamation-triangle",
|
||||
Label = "System · Workspace + ToolChoice: any",
|
||||
Content = @$"## KRITISCH: Tool-Nutzung
|
||||
JEDE Datei-Operation und JEDER Shell-Befehl MUSS über einen Tool-Aufruf erfolgen. NIEMALS eine Aktion nur beschreiben oder behaupten - IMMER das Tool tatsächlich aufrufen."
|
||||
});
|
||||
}
|
||||
|
||||
if (planMode)
|
||||
{
|
||||
blocks.Add(new PromptBlock
|
||||
@@ -207,31 +194,7 @@ Alle Dateipfade in Tool-Aufrufen müssen relativ zu diesem Workspace sein oder a
|
||||
// autoCommit == "" → kein Block, Thema wird nicht erwähnt
|
||||
}
|
||||
|
||||
if (toolAny && !string.IsNullOrWhiteSpace(effectiveWorkspace) && !planMode)
|
||||
{
|
||||
blocks.Add(new PromptBlock
|
||||
{
|
||||
Icon = "fa-cog",
|
||||
Label = "Agent · Verhalten (Workspace + ToolChoice: any)",
|
||||
Content = string.Join("\n", new[]
|
||||
{
|
||||
"## Verhalten",
|
||||
"- Wenn du Dateien lesen, schreiben, bearbeiten, erstellen oder löschen willst: IMMER das entsprechende Tool aufrufen. NIEMALS den Inhalt nur in die Antwort schreiben.",
|
||||
"- Wenn du Shell-Befehle ausführen willst: IMMER das execute-Tool verwenden.",
|
||||
"- Behaupte NIEMALS etwas getan zu haben (Datei geschrieben, Commit gemacht, Befehl ausgeführt) ohne das entsprechende Tool tatsächlich aufgerufen zu haben. Wenn kein Tool-Aufruf stattgefunden hat, ist nichts passiert.",
|
||||
"- Plane nicht nur - handle sofort über Tool-Aufrufe."
|
||||
})
|
||||
});
|
||||
|
||||
blocks.Add(new PromptBlock
|
||||
{
|
||||
Icon = "fa-exclamation-circle",
|
||||
Label = "System · Erinnerung (Workspace + ToolChoice: any)",
|
||||
Content = @"## ERINNERUNG
|
||||
Diese Regel hat höchste Priorität und gilt für JEDE Antwort: Wenn eine Datei gelesen, geschrieben, bearbeitet, erstellt oder gelöscht werden soll, oder ein Befehl ausgeführt werden soll, MUSS der entsprechende Tool-Aufruf erfolgen. Ohne Tool-Aufruf ist NICHTS passiert. Beschreibe keine Änderungen - führe sie durch."
|
||||
});
|
||||
}
|
||||
// kein extra Erinnerungsblock ohne toolAny – Zeilenreferenz-Hinweise kommen direkt über die Nachricht
|
||||
|
||||
// Plan-Modus-Block
|
||||
if (planMode)
|
||||
|
||||
Reference in new issue
Block a user