feat(worker): accept #123 task numbers as MCP tool input
TaskIdResolver resolves a #123/bare-123 taskId parameter to its GUID before any lookup, across every External/ MCP tool that takes a task id, including the batch tools' id arrays (via delegation to the already-resolving single-entity methods) and update_task's dependsOnTaskId (empty string still passes through unchanged as the clear-link sentinel). An unknown number throws a clear error instead of a silent null. McpToolDocs.TaskNumberHint tells the agent to refer to tasks as #<number> when reporting to the user, added to the description of get_task, list_tasks, add_task, update_task_status and review_task.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using ClaudeDo.Worker.External;
|
||||
using Microsoft.Extensions.AI;
|
||||
@@ -71,4 +72,16 @@ public sealed class ExternalMcpToolSchemaTests
|
||||
// (e.g. namespace/attribute mismatch) and the schema test above would pass vacuously.
|
||||
Assert.True(ExternalToolMethods().Count() > 20);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AtLeastOneTaskIdTool_DescriptionCarriesTaskNumberHint()
|
||||
{
|
||||
// The whole point of task numbers: without this clause the agent never learns to speak
|
||||
// #<number> to the user, even though every DTO already carries it.
|
||||
var hasHint = ExternalToolMethods()
|
||||
.Select(m => m.GetCustomAttribute<DescriptionAttribute>()?.Description ?? "")
|
||||
.Any(d => d.Contains(McpToolDocs.TaskNumberHint.Trim(), StringComparison.Ordinal));
|
||||
|
||||
Assert.True(hasHint, "No external tool description carries McpToolDocs.TaskNumberHint.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user