Skip to content

DeepSeek/GoogleGenAi: wire core.retry RetryTemplate to avoid model-level double-retry #1811

Description

@alexheifetz

Summary

DeepSeekModelsConfig.kt and GoogleGenAiModelsConfig.kt comment out .retryTemplate(...) on the Spring AI 2.0 chat-model builder (note: "wrap with spring-retry at ChatClientLlmOperations, so omitted here").

Impact

Omitting the retry template does not mean "no retry" — the model then falls back to its built-in RetryUtils.DEFAULT_RETRY_TEMPLATE (10 attempts, exponential backoff up to ~3 minutes), which runs in addition to the platform-layer retry at ChatClientLlmOperations. A slow or timing-out call can retry ~10× at the model layer before the platform even sees it (this is exactly what made a Mistral test appear to hang until it was fixed).

Fix

Mirror the fix already applied to MistralAiModelsConfig: build a Spring Framework 7 org.springframework.core.retry.RetryTemplate from the retry properties (maxRetries = maxAttempts - 1, plus delay/multiplier/maxDelay) and pass it to .retryTemplate(...).

Files:

  • embabel-agent-autoconfigure/models/embabel-agent-deepseek-autoconfigure/.../DeepSeekModelsConfig.kt
  • embabel-agent-autoconfigure/models/embabel-agent-google-genai-autoconfigure/.../GoogleGenAiModelsConfig.kt

Follow-up from the Spring AI 2.0 sync (same latent issue Mistral had).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions