The list-handler prompt (MergeHelperDefault) tells the handler to read maxParallelExecutions via get_app_settings, but the DTO never carried the field. Handler had to fall back to reading app_settings directly from the DB on the 2026-07-29 E2E run.
34 lines
1.4 KiB
C#
34 lines
1.4 KiB
C#
using System.ComponentModel;
|
|
using ClaudeDo.Data;
|
|
using ClaudeDo.Data.Repositories;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using ModelContextProtocol.Server;
|
|
|
|
namespace ClaudeDo.Worker.External;
|
|
|
|
public sealed record AppSettingsReadDto(
|
|
string DefaultModel, int DefaultMaxTurns, string DefaultPermissionMode,
|
|
int MaxParallelExecutions,
|
|
string WorktreeStrategy, string? CentralWorktreeRoot,
|
|
bool WorktreeAutoCleanupEnabled, int WorktreeAutoCleanupDays);
|
|
|
|
[McpServerToolType]
|
|
public sealed class AppSettingsMcpTools
|
|
{
|
|
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
|
|
|
public AppSettingsMcpTools(IDbContextFactory<ClaudeDoDbContext> dbFactory) => _dbFactory = dbFactory;
|
|
|
|
[McpServerTool, Description("Read the worker's app-level defaults (model, max turns, permission mode, max parallel execution slots, worktree strategy). Read-only.")]
|
|
public async Task<AppSettingsReadDto> GetAppSettings(CancellationToken cancellationToken)
|
|
{
|
|
using var ctx = await _dbFactory.CreateDbContextAsync(cancellationToken);
|
|
var row = await new AppSettingsRepository(ctx).GetAsync(cancellationToken);
|
|
return new AppSettingsReadDto(
|
|
row.DefaultModel, row.DefaultMaxTurns, row.DefaultPermissionMode,
|
|
row.MaxParallelExecutions,
|
|
row.WorktreeStrategy, row.CentralWorktreeRoot,
|
|
row.WorktreeAutoCleanupEnabled, row.WorktreeAutoCleanupDays);
|
|
}
|
|
}
|