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>
37 lines
933 B
C#
37 lines
933 B
C#
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);
|
|
}
|
|
}
|