Kujtim Hoxha 10 месяцев назад
Родитель
Сommit
1da298e755
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      internal/llm/provider/anthropic.go
  2. 1 1
      internal/llm/tools/patch.go

+ 1 - 1
internal/llm/provider/anthropic.go

@@ -59,7 +59,7 @@ func newAnthropicClient(opts providerClientOptions) AnthropicClient {
 func (a *anthropicClient) convertMessages(messages []message.Message) (anthropicMessages []anthropic.MessageParam) {
 	for i, msg := range messages {
 		cache := false
-		if len(messages)-3 > i {
+		if i > len(messages)-3 {
 			cache = true
 		}
 		switch msg.Role {

+ 1 - 1
internal/llm/tools/patch.go

@@ -169,7 +169,7 @@ func (p *patchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
 		return NewTextErrorResponse(fmt.Sprintf("failed to parse patch: %s", err)), nil
 	}
 
-	if fuzz > 0 {
+	if fuzz > 3 {
 		return NewTextErrorResponse(fmt.Sprintf("patch contains fuzzy matches (fuzz level: %d). Please make your context lines more precise", fuzz)), nil
 	}