on main help sign in
fix anthropic
commit1da298e7554bab0f7a631a44fed12692d668c024 authorKujtim Hoxha <kujtimii.h@gmail.com> dateMon 21 Apr 2025, 07:20 (2 years ago) parentc40e684
2 files changed+2−2
internal/llm/provider/anthropic.go+1−1 internal/llm/tools/patch.go+1−1
internal/llm/provider/anthropic.go+1−1
@@ -59,7 +59,7 @@ func newAnthropicClient(opts providerClientOptions) AnthropicClient {
5959func (a *anthropicClient) convertMessages(messages []message.Message) (anthropicMessages []anthropic.MessageParam) {
6060 for i, msg := range messages {
6161 cache := false
62− if len(messages)-3 > i {
62+ if i > len(messages)-3 {
6363 cache = true
6464 }
6565 switch msg.Role {
internal/llm/tools/patch.go+1−1
@@ -169,7 +169,7 @@ func (p *patchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
169169 return NewTextErrorResponse(fmt.Sprintf("failed to parse patch: %s", err)), nil
170170 }
171171
172− if fuzz > 0 {
172+ if fuzz > 3 {
173173 return NewTextErrorResponse(fmt.Sprintf("patch contains fuzzy matches (fuzz level: %d). Please make your context lines more precise", fuzz)), nil
174174 }
175175