feat: Auto-Commit Flag für Agents - neues Property AgentRecord.AutoCommit (bool) - DB-Migration: agents.auto_commit INTEGER NOT NULL DEFAULT 0 - Agent Create/Update um autoCommit erweitert - SystemPromptBuilder: bedingte Commit-Regel im Verhalten-Abschnitt - AutoCommit=true: Agent MUSS nach Änderungen committen - AutoCommit=false: Agent darf NIE eigenständig committen - Frontend: Checkbox 'Auto-Commit erlauben' in Agent-Settings

This commit is contained in:
Meleki committed 2026-03-01 01:46:04 +01:00
1 parent ab4ce839b4
commit 5037c7d24e
6 files changed
+35 -10

No files matched your search

+4 -3
View File
@@ -129,6 +129,7 @@ public class DatabaseService
TryAddColumn(conn, "agents", "tool_choice", "TEXT DEFAULT 'any'");
TryAddColumn(conn, "agents", "custom_commands", "TEXT");
TryAddColumn(conn, "messages", "is_marked", "INTEGER NOT NULL DEFAULT 0");
TryAddColumn(conn, "agents", "auto_commit", "INTEGER NOT NULL DEFAULT 0");
}
private void TryAddColumn(SqliteConnection conn, string table, string column, string type)
@@ -147,8 +148,8 @@ public class DatabaseService
agent.CreatedAt = now;
agent.UpdatedAt = now;
await conn.ExecuteAsync(@"
INSERT INTO agents (agent_id, name, avatar, description, model, persona, instructions, tool_choice, custom_commands, is_deleted, created_at, updated_at)
VALUES (@AgentId, @Name, @Avatar, @Description, @Model, @Persona, @Instructions, @ToolChoice, @CustomCommands, 0, @CreatedAt, @UpdatedAt)
INSERT INTO agents (agent_id, name, avatar, description, model, persona, instructions, tool_choice, custom_commands, auto_commit, is_deleted, created_at, updated_at)
VALUES (@AgentId, @Name, @Avatar, @Description, @Model, @Persona, @Instructions, @ToolChoice, @CustomCommands, @AutoCommit, 0, @CreatedAt, @UpdatedAt)
", agent);
return agent;
}
@@ -174,7 +175,7 @@ public class DatabaseService
await conn.ExecuteAsync(@"
UPDATE agents SET name = @Name, avatar = @Avatar, description = @Description,
model = @Model, persona = @Persona, instructions = @Instructions, tool_choice = @ToolChoice,
custom_commands = @CustomCommands, updated_at = @UpdatedAt
custom_commands = @CustomCommands, auto_commit = @AutoCommit, updated_at = @UpdatedAt
WHERE agent_id = @AgentId
", agent);
}