diff options
Diffstat (limited to 'internal/llm/provider')
| -rw-r--r-- | internal/llm/provider/anthropic.go | 5 | ||||
| -rw-r--r-- | internal/llm/provider/gemini.go | 5 | ||||
| -rw-r--r-- | internal/llm/provider/openai.go | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/internal/llm/provider/anthropic.go b/internal/llm/provider/anthropic.go index cb78ddf55..edd1c1d70 100644 --- a/internal/llm/provider/anthropic.go +++ b/internal/llm/provider/anthropic.go @@ -17,6 +17,7 @@ import ( "github.com/opencode-ai/opencode/internal/llm/tools" "github.com/opencode-ai/opencode/internal/logging" "github.com/opencode-ai/opencode/internal/message" + "github.com/opencode-ai/opencode/internal/status" ) type anthropicOptions struct { @@ -227,7 +228,7 @@ func (a *anthropicClient) send(ctx context.Context, messages []message.Message, return nil, retryErr } if retry { - logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100)) + status.Warn(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries)) select { case <-ctx.Done(): return nil, ctx.Err() @@ -365,7 +366,7 @@ func (a *anthropicClient) stream(ctx context.Context, messages []message.Message return } if retry { - logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100)) + status.Warn(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries)) select { case <-ctx.Done(): // context cancelled diff --git a/internal/llm/provider/gemini.go b/internal/llm/provider/gemini.go index 9aee8e53a..2986c715e 100644 --- a/internal/llm/provider/gemini.go +++ b/internal/llm/provider/gemini.go @@ -15,6 +15,7 @@ import ( "github.com/opencode-ai/opencode/internal/llm/tools" "github.com/opencode-ai/opencode/internal/logging" "github.com/opencode-ai/opencode/internal/message" + "github.com/opencode-ai/opencode/internal/status" "google.golang.org/api/iterator" "google.golang.org/api/option" ) @@ -195,7 +196,7 @@ func (g *geminiClient) send(ctx context.Context, messages []message.Message, too return nil, retryErr } if retry { - logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100)) + status.Warn(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries)) select { case <-ctx.Done(): return nil, ctx.Err() @@ -297,7 +298,7 @@ func (g *geminiClient) stream(ctx context.Context, messages []message.Message, t return } if retry { - logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100)) + status.Warn(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries)) select { case <-ctx.Done(): if ctx.Err() != nil { diff --git a/internal/llm/provider/openai.go b/internal/llm/provider/openai.go index 0b690e3c2..3bf8a6d42 100644 --- a/internal/llm/provider/openai.go +++ b/internal/llm/provider/openai.go @@ -16,6 +16,7 @@ import ( "github.com/opencode-ai/opencode/internal/llm/tools" "github.com/opencode-ai/opencode/internal/logging" "github.com/opencode-ai/opencode/internal/message" + "github.com/opencode-ai/opencode/internal/status" ) type openaiOptions struct { @@ -214,7 +215,7 @@ func (o *openaiClient) send(ctx context.Context, messages []message.Message, too return nil, retryErr } if retry { - logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100)) + status.Warn(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries)) select { case <-ctx.Done(): return nil, ctx.Err() @@ -320,7 +321,7 @@ func (o *openaiClient) stream(ctx context.Context, messages []message.Message, t return } if retry { - logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100)) + status.Warn(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries)) select { case <-ctx.Done(): // context cancelled |
