feat(worker): let Claude set the cheapest model per generated task via MCP
AddTask, planning CreateChildTask, and SuggestImprovement now accept an optional alias-validated model (haiku/sonnet/opus; blank = inherit) so the model is chosen at creation time instead of a follow-up set_task_config call. The planning, system, and improvement prompts instruct Claude to pick the cheapest capable model (haiku < sonnet < opus). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
36
tests/ClaudeDo.Data.Tests/ModelRegistryTests.cs
Normal file
36
tests/ClaudeDo.Data.Tests/ModelRegistryTests.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
|
||||
namespace ClaudeDo.Data.Tests;
|
||||
|
||||
public class ModelRegistryTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("sonnet", "sonnet")]
|
||||
[InlineData("OPUS", "opus")]
|
||||
[InlineData(" haiku ", "haiku")]
|
||||
public void NormalizeAlias_canonicalizes_known_aliases(string input, string expected)
|
||||
{
|
||||
Assert.Equal(expected, ModelRegistry.NormalizeAlias(input));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
public void NormalizeAlias_blank_means_inherit(string? input)
|
||||
{
|
||||
Assert.Null(ModelRegistry.NormalizeAlias(input));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NormalizeAlias_unknown_throws()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => ModelRegistry.NormalizeAlias("gpt4"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ByCostAscending_is_haiku_sonnet_opus()
|
||||
{
|
||||
Assert.Equal(new[] { "haiku", "sonnet", "opus" }, ModelRegistry.ByCostAscending);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user