temporal-spring-ai: a provider 429 fails the chat activity on the first attempt
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with ActivityChatModel.java:111-114 and the reported ProviderRateLimitRetryTest cases; the issue does not give the test's file path. Compare the activity's retry behavior with Spring AI's default handling of 429 and its inner retries. The issue describes possible approaches but leaves the policy to the team; done should address the reported 429 and 503 cases, including the Retry-After and insufficient_quota distinction.
索引モデルが issue の本文から書いたものです。
説明
Expected Behavior
A rate-limited LLM call (HTTP 429) through ActivityChatModel is retried by Temporal with backoff. sdk-python's OpenAI Agents integration already treats 429 as retryable and passes the provider's retry delay through (temporalio/sdk-python#1796).
Actual Behavior
The activity fails on attempt 1 with RETRY_STATE_NON_RETRYABLE_FAILURE. Spring AI's default error handlers, both the plain builder default and the Boot auto-configured one, turn every 4xx, 429 included, into NonTransientAiException (RetryUtils in Spring AI 1.1.0), and ActivityChatModel puts that type in doNotRetry by default (ActivityChatModel.java:111-114).
A related interaction on 5xx: Spring AI's own RetryTemplate (10 attempts, backoff up to 3 minutes) runs inside the activity, so a persistent 503 can send up to 30 requests across Temporal's 3 attempts. The activity has a 2-minute start-to-close and no heartbeat, so a timed-out attempt can keep calling the provider while later attempts run. sdk-python turned off Botocore's inner retries for its default Strands Bedrock model for a similar reason (temporalio/sdk-python#1797).
Steps to Reproduce the Problem
- Point a real
OpenAiChatModelat a local stub that returns 429 withRetry-After: 7, register it withChatModelActivityImpl, and call it from a workflow throughActivityChatModel.forDefault(). - The stub sees one request; the workflow gets
ActivityFailurecaused byApplicationFailureof typeNonTransientAiException, attempt 1. - With a 503 stub and Spring AI's backoff shortened to milliseconds, the stub sees 30 requests.
I have this as a test (ProviderRateLimitRetryTest, five cases, including Boot-equivalent defaults and spring.ai.retry.on-http-codes=429). For a fix I'd rather not parse exception messages, but Spring AI's handlers throw NonTransientAiException with only a message, so the status survives only in the message and the headers are gone by the time the activity sees it. The OpenAI path could instead use a response error handler, scoped to the client Temporal calls, that keeps status, headers and the error body; the activity can then retry rate limits with Retry-After as the next delay and leave insufficient_quota 429s non-retryable, since backoff won't fix a billing limit. Whether the module should also turn off Spring AI's inner retry for calls it wraps seems like your team's call; I'll follow whichever direction you prefer.
Specifications
- Version: sdk-java main (be01e60a), Spring AI 1.1.0
- Platform: JDK 21, macOS
- 主要言語
- Java
- スター
- 433
- フォーク
- 257
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
temporalio/sdk-java のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
temporalio/sdk-java#1825 ·
メンテナーはふだん 1 日以内に返信
-
Allow a timer summary on Workflow.sleep and Workflow.await with timeout対応中かも @sangkyoonnam が 4 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
temporalio/sdk-java#3108 ·
メンテナーはふだん 1 日以内に返信
-
Local activity scheduleToClose budget restarts when a timer-backed retry runs on replay対応中かも @sangkyoonnam が 4 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
temporalio/sdk-java#3106 ·
メンテナーはふだん 1 日以内に返信
-
Warn if the SDK tried to send a payload above a specific size - Java対応中かも @jmaeagle99 が 26 日前に担当しました。 オープン
temporalio/sdk-java#3059 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Promise.get(timeout, unit) throws a misleading TimeoutException when the workflow is canceled対応中かも @Quinn-With-Two-Ns が 41 日前に担当しました。 オープン
temporalio/sdk-java#3026 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
temporalio/sdk-java の issue をすべて見る
似ている issue
-
component/operate kind/feature-request
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Forge coverage prompts carry text the agent cannot act on対応中かも @graalvmbot が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
oracle/graalvm-reachability-metadata#10572 ·
メンテナーはふだん 1 日以内に返信
-
[CI] Core CI doesn't run for changes to amoro-format-lance (and amoro-web)対応中かも @MarkAlex1234 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
area/docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信