summaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-21 07:20:09 +0200
committerKujtim Hoxha <[email protected]>2025-04-21 13:42:29 +0200
commit1da298e7554bab0f7a631a44fed12692d668c024 (patch)
treebf8c3ed766373802d92d6cfca7d923e16ebcf258 /internal
parentc40e68496d4ed5a7db47879376dec293a9e82856 (diff)
downloadopencode-1da298e7554bab0f7a631a44fed12692d668c024.tar.gz
opencode-1da298e7554bab0f7a631a44fed12692d668c024.zip
fix anthropic
Diffstat (limited to 'internal')
-rw-r--r--internal/llm/provider/anthropic.go2
-rw-r--r--internal/llm/tools/patch.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/llm/provider/anthropic.go b/internal/llm/provider/anthropic.go
index 86f483f64..03d96fb24 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 0f879462c..92eab6929 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
}