fix(worker): register TaskRepository in DI and guard null WorkingDir

This commit is contained in:
mika kuns
2026-04-23 23:17:30 +02:00
parent 6cb20a9213
commit c048264b95
2 changed files with 5 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ public sealed class PlanningSessionManager
var list = await lists.GetByIdAsync(task.ListId, ct)
?? throw new InvalidOperationException($"List {task.ListId} not found.");
return new PlanningSessionStartContext(taskId, list.WorkingDir, files);
return new PlanningSessionStartContext(taskId, list.WorkingDir ?? throw new InvalidOperationException($"List {task.ListId} has no working directory configured."), files);
}
public async Task<int> FinalizeAsync(string taskId, bool queueAgentTasks, CancellationToken ct)
@@ -125,7 +125,7 @@ public sealed class PlanningSessionManager
var list = await lists.GetByIdAsync(task.ListId, ct)
?? throw new InvalidOperationException($"List {task.ListId} not found.");
return new PlanningSessionResumeContext(taskId, list.WorkingDir, task.PlanningSessionId, mcpConfigPath);
return new PlanningSessionResumeContext(taskId, list.WorkingDir ?? throw new InvalidOperationException($"List {task.ListId} has no working directory configured."), task.PlanningSessionId, mcpConfigPath);
}
private static string GenerateToken()