@@ -8,13 +8,13 @@ import (
88 "io"
99 "time"
1010
11+ "github.com/openai/openai-go"
12+ "github.com/openai/openai-go/option"
13+ "github.com/openai/openai-go/shared"
1114 "github.com/opencode-ai/opencode/internal/config"
1215 "github.com/opencode-ai/opencode/internal/llm/tools"
1316 "github.com/opencode-ai/opencode/internal/logging"
1417 "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"
1818)
1919
2020type openaiOptions struct {
@@ -188,7 +188,7 @@ func (o *openaiClient) send(ctx context.Context, messages []message.Message, too
188188 return nil, retryErr
189189 }
190190 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))
192192 select {
193193 case <-ctx.Done():
194194 return nil, ctx.Err()
@@ -288,7 +288,7 @@ func (o *openaiClient) stream(ctx context.Context, messages []message.Message, t
288288 return
289289 }
290290 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))
292292 select {
293293 case <-ctx.Done():
294294 // context cancelled