fix anthropic

Kujtim Hoxha created

Change summary

internal/llm/provider/anthropic.go | 2 +-
internal/llm/tools/patch.go        | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Detailed changes

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 {

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
 	}