feat(config): Permission-Modus pro Liste und pro Task ueberschreibbar

Bisher gab es nur AppSettings.DefaultPermissionMode global — ein Task, der plan
oder acceptEdits braucht, erzwang das Umstellen der globalen Einstellung. Neue
Spalten tasks.permission_mode und list_config.permission_mode, Auflösung
task -> list -> global im EffectiveRunConfigResolver (den TaskRunner und
get_effective_run_config gemeinsam nutzen), ComboBox mit Inherited-Badge im
geteilten Agent-Editor.

MigrationBaselineTests: das Fixture baute per EnsureCreated das heutige Schema
und stempelte Legacy-History darauf — jede Migration nach dem Squash lief damit
in 'duplicate column name'. Es migriert jetzt gezielt bis InitialCreate und
prueft 'nichts pending' statt 'InitialCreate ist die einzige Zeile'.
This commit is contained in:
mika kuns
2026-08-27 10:28:57 +02:00
parent 5cc99bfec6
commit 4464dc6ff1
18 changed files with 1168 additions and 48 deletions
+9 -3
View File
@@ -81,7 +81,8 @@ public sealed class ConfigMcpTools
"in this list that don't override them (verify command is list-only; tasks cannot override it). Only " +
"the fields you pass are changed; omitted fields keep their current value. To clear a field instead, " +
"name it in clearFields; clearing all five deletes the list's config unless it also carries settings " +
"this tool doesn't expose (session skills, file-scope serialization), which are always preserved.")]
"this tool doesn't expose (session skills, file-scope serialization, permission mode), which are " +
"always preserved.")]
public async Task<SetListConfigResult> SetListConfig(
string listId, string? model = null, string? systemPrompt = null, string? agentPath = null,
int? maxTurns = null, string? verifyCommand = null,
@@ -107,7 +108,8 @@ public sealed class ConfigMcpTools
// at its default would silently reset (a SerializeOnFileOverlap reset only shows up as
// tasks no longer serializing, long after this write).
var hasUnrelatedSettings = existing is not null
&& (existing.SessionSkills is not null || existing.SerializeOnFileOverlap);
&& (existing.SessionSkills is not null || existing.SerializeOnFileOverlap
|| existing.PermissionMode is not null);
ListConfigDto? config;
var allCleared = m is null && sp is null && ap is null && mt is null && vc is null;
@@ -127,6 +129,7 @@ public sealed class ConfigMcpTools
ListId = listId, Model = m, SystemPrompt = sp, AgentPath = ap, MaxTurns = mt,
VerifyCommand = vc, SessionSkills = existing?.SessionSkills,
SerializeOnFileOverlap = existing?.SerializeOnFileOverlap ?? false,
PermissionMode = existing?.PermissionMode,
}, cancellationToken);
config = allCleared ? null : new ListConfigDto(m, sp, ap, mt, vc);
}
@@ -158,7 +161,10 @@ public sealed class ConfigMcpTools
var ap = clear.Contains("agentPath") ? null : agentPath.NullIfBlank() ?? task.AgentPath;
var mt = clear.Contains("maxTurns") ? null : maxTurns ?? task.MaxTurns;
await _tasks.UpdateAgentSettingsAsync(taskId, m, sp, ap, mt, task.SessionSkills, cancellationToken);
// SessionSkills and PermissionMode aren't exposed here but share the write — UpdateAgentSettings
// sets every column, so passing the current value is what keeps them from being cleared.
await _tasks.UpdateAgentSettingsAsync(
taskId, m, sp, ap, mt, task.SessionSkills, task.PermissionMode, cancellationToken);
await _broadcaster.TaskUpdated(taskId);
return new SetTaskConfigResult(true, taskId, task.Number, new TaskConfigDto(m, sp, ap, mt));
}