feat(worker): warn on near-duplicate titles in add_task/batch_add_tasks
add_task and batch_add_tasks now report up to 3 open (non-terminal)
tasks in the same list with a strongly overlapping title, so a
parallel agent can notice and mention a likely duplicate instead of
silently creating one. The task is always created regardless. Uses a
cheap normalized-word overlap heuristic (no embeddings/LLM call),
robust to German umlaut/digraph spelling variants. Breaking change:
AddTask now returns AddTaskResult { task, possibleDuplicates } instead
of a bare TaskRefDto; BatchAddTaskResult gained a PossibleDuplicates
field.
This commit is contained in:
@@ -142,6 +142,24 @@ public sealed class BatchMcpToolsTests : IDisposable
|
||||
Assert.Equal(2, inList.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task BatchAddTasks_SimilarTitleInSameList_ReportsPossibleDuplicate()
|
||||
{
|
||||
var listId = await SeedListAsync();
|
||||
await SeedTaskAsync(listId, "MaxTurnsCeiling ohne Bedienoberflaeche im Settings-Modal", TaskStatus.Idle);
|
||||
var sut = BuildSut();
|
||||
|
||||
var results = await sut.BatchAddTasks(listId, new[]
|
||||
{
|
||||
new BatchAddTaskInput("Settings: MaxTurnsCeiling editierbar machen"),
|
||||
}, cancellationToken: CancellationToken.None);
|
||||
|
||||
var result = Assert.Single(results);
|
||||
Assert.True(result.Ok);
|
||||
Assert.NotNull(result.PossibleDuplicates);
|
||||
Assert.Single(result.PossibleDuplicates!);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task BatchGetTasks_MissingId_IsFoundFalseNotError()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user