Skip to content

The open source coding agent.

TypeScript

fix anthropic

Kujtim Hoxha1da298e7554b
diff --git a/internal/llm/provider/anthropic.go b/internal/llm/provider/anthropic.go
index 86f483f649a..03d96fb2497 100644
--- a/internal/llm/provider/anthropic.go
+++ b/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 {
diff --git a/internal/llm/tools/patch.go b/internal/llm/tools/patch.go
index 0f879462caf..92eab69297a 100644
--- a/internal/llm/tools/patch.go
+++ b/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
}