Release v1.4.4

This commit is contained in:
lutc5
2026-05-06 11:03:55 +08:00
parent a02fd51c19
commit a3a9c278f6
9 changed files with 542 additions and 42 deletions

View File

@@ -83,7 +83,8 @@ func TestInjectToolingIncludesAutoToolGuidance(t *testing.T) {
for _, want := range []string{
"tool_choice=auto means you must decide",
"inspect a local file path",
"Core tool examples",
"Core tool syntax examples",
"conceptual question",
"NEVER ask the user to run a command",
} {
if !strings.Contains(prompt, want) {
@@ -92,6 +93,27 @@ func TestInjectToolingIncludesAutoToolGuidance(t *testing.T) {
}
}
func TestExtractAnthropicToolsSkipsHostedWebSearch(t *testing.T) {
tools := ExtractAnthropicTools([]any{
map[string]any{
"name": "web_search",
"type": "web_search_20250305",
},
map[string]any{
"name": "read_file",
"input_schema": map[string]any{
"type": "object",
},
},
})
if len(tools) != 1 {
t.Fatalf("tool count = %d", len(tools))
}
if tools[0].Name != "read_file" {
t.Fatalf("tool = %+v", tools[0])
}
}
func TestParseActionBlocksMapsCommonToolAliases(t *testing.T) {
text := "```json action\n{\"tool\":\"Bash\",\"parameters\":{\"command\":\"pwd\",\"extra\":true}}\n```"
calls, clean, err := ParseActionBlocks(text, []ToolDef{{