- GitService.MergeFfOnlyAsync had no callers anywhere in code; removed. - AgentMcpTools moved out of LifecycleMcpTools.cs into External/AgentMcpTools.cs (no behavior change). - Worker CLAUDE.md described ZitadelAuthProvider as a Phase 2 stub; it's fully implemented (OIDC discovery + refresh-token flow), updated both mentions.
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System.ComponentModel;
|
|
using ClaudeDo.Data.Repositories;
|
|
using ClaudeDo.Worker.Lifecycle;
|
|
using ModelContextProtocol.Server;
|
|
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
|
|
|
|
namespace ClaudeDo.Worker.External;
|
|
|
|
[McpServerToolType]
|
|
public sealed class LifecycleMcpTools
|
|
{
|
|
private readonly TaskRepository _tasks;
|
|
private readonly TaskResetService _reset;
|
|
|
|
public LifecycleMcpTools(TaskRepository tasks, TaskResetService reset)
|
|
{
|
|
_tasks = tasks;
|
|
_reset = reset;
|
|
}
|
|
|
|
[McpServerTool, Description("Reset a failed task: discards its worktree and returns it to Idle so it can be run again. Only Failed tasks are accepted.")]
|
|
public async Task ResetFailedTask(string taskId, CancellationToken cancellationToken)
|
|
{
|
|
var task = await _tasks.GetByIdAsync(taskId, cancellationToken)
|
|
?? throw new InvalidOperationException($"Task {taskId} not found.");
|
|
if (task.Status != TaskStatus.Failed)
|
|
throw new InvalidOperationException($"Task {taskId} is {task.Status}, not Failed. Only failed tasks can be reset via this tool.");
|
|
|
|
await _reset.ResetAsync(taskId, cancellationToken);
|
|
}
|
|
}
|