@@ -8,13 +8,13 @@ import (
11+ "github.com/openai/openai-go"
12+ "github.com/openai/openai-go/option"
13+ "github.com/openai/openai-go/shared"
11 "github.com/opencode-ai/opencode/internal/config"
14 "github.com/opencode-ai/opencode/internal/config"
12 "github.com/opencode-ai/opencode/internal/llm/tools"
15 "github.com/opencode-ai/opencode/internal/llm/tools"
13 "github.com/opencode-ai/opencode/internal/logging"
16 "github.com/opencode-ai/opencode/internal/logging"
14 "github.com/opencode-ai/opencode/internal/message"
17 "github.com/opencode-ai/opencode/internal/message"
15− "github.com/openai/openai-go"
16− "github.com/openai/openai-go/option"
17− "github.com/openai/openai-go/shared"
20type openaiOptions struct {
20type openaiOptions struct {
@@ -188,7 +188,7 @@ func (o *openaiClient) send(ctx context.Context, messages []message.Message, too
188 return nil, retryErr
188 return nil, retryErr
190 if retry {
190 if retry {
191− logging.WarnPersist("Retrying due to rate limit... attempt %d of %d", logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
191+ logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
193 case <-ctx.Done():
193 case <-ctx.Done():
194 return nil, ctx.Err()
194 return nil, ctx.Err()
@@ -288,7 +288,7 @@ func (o *openaiClient) stream(ctx context.Context, messages []message.Message, t
290 if retry {
290 if retry {
291− logging.WarnPersist("Retrying due to rate limit... attempt %d of %d", logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
291+ logging.WarnPersist(fmt.Sprintf("Retrying due to rate limit... attempt %d of %d", attempts, maxRetries), logging.PersistTimeArg, time.Millisecond*time.Duration(after+100))
293 case <-ctx.Done():
293 case <-ctx.Done():
294 // context cancelled
294 // context cancelled