feat(data): per-list base branch, preserved by every config writer
This commit is contained in:
+8
-5
@@ -10,7 +10,7 @@ using ModelContextProtocol.Server;
|
||||
namespace ClaudeDo.Worker.External;
|
||||
|
||||
public sealed record TaskConfigDto(string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns);
|
||||
public sealed record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns, string? VerifyCommand);
|
||||
public sealed record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns, string? VerifyCommand, string? BaseBranch = null);
|
||||
public sealed record TaskConfigResult(bool Found, TaskConfigDto? Config);
|
||||
public sealed record ListConfigResult(bool Found, ListConfigDto? Config);
|
||||
public sealed record SetListConfigResult(bool Ok, string ListId, ListConfigDto? Config);
|
||||
@@ -55,7 +55,7 @@ public sealed class ConfigMcpTools
|
||||
var cfg = await _lists.GetConfigAsync(listId, cancellationToken);
|
||||
return cfg is null
|
||||
? new ListConfigResult(false, null)
|
||||
: new ListConfigResult(true, new ListConfigDto(cfg.Model, cfg.SystemPrompt, cfg.AgentPath, cfg.MaxTurns, cfg.VerifyCommand));
|
||||
: new ListConfigResult(true, new ListConfigDto(cfg.Model, cfg.SystemPrompt, cfg.AgentPath, cfg.MaxTurns, cfg.VerifyCommand, cfg.BaseBranch));
|
||||
}
|
||||
|
||||
// clearFields (not a per-field sentinel like UpdateList's "" for workingDir) because maxTurns is an
|
||||
@@ -81,7 +81,7 @@ 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, permission mode), which are " +
|
||||
"this tool doesn't expose (session skills, permission mode, ticket link, base branch, PowerUse opt-in), which are " +
|
||||
"always preserved.")]
|
||||
public async Task<SetListConfigResult> SetListConfig(
|
||||
string listId, string? model = null, string? systemPrompt = null, string? agentPath = null,
|
||||
@@ -110,7 +110,8 @@ public sealed class ConfigMcpTools
|
||||
// UI-only).
|
||||
var hasUnrelatedSettings = existing is not null
|
||||
&& (existing.SessionSkills is not null
|
||||
|| existing.PermissionMode is not null || existing.TicketProjectId is not null);
|
||||
|| existing.PermissionMode is not null || existing.TicketProjectId is not null
|
||||
|| existing.BaseBranch is not null || existing.PowerUseAllowed);
|
||||
|
||||
ListConfigDto? config;
|
||||
var allCleared = m is null && sp is null && ap is null && mt is null && vc is null;
|
||||
@@ -131,8 +132,10 @@ public sealed class ConfigMcpTools
|
||||
VerifyCommand = vc, SessionSkills = existing?.SessionSkills,
|
||||
PermissionMode = existing?.PermissionMode,
|
||||
TicketProjectId = existing?.TicketProjectId,
|
||||
BaseBranch = existing?.BaseBranch,
|
||||
PowerUseAllowed = existing?.PowerUseAllowed ?? false,
|
||||
}, cancellationToken);
|
||||
config = allCleared ? null : new ListConfigDto(m, sp, ap, mt, vc);
|
||||
config = allCleared ? null : new ListConfigDto(m, sp, ap, mt, vc, existing?.BaseBranch);
|
||||
}
|
||||
|
||||
await _broadcaster.ListUpdated(listId);
|
||||
|
||||
Reference in New Issue
Block a user