Commit 2a76e4e
temporal-spring-ai: accept ActivityOptions and classify non-retryable AI errors
- ActivityChatModel.forDefault(ActivityOptions) and forModel(String,
ActivityOptions) overloads added. New public defaultActivityOptions()
returns the plugin's default bundle so callers can tweak one field
without losing the other sensible defaults.
- ActivityMcpClient.create(ActivityOptions) + defaultActivityOptions()
added, mirroring the chat side.
- Default RetryOptions for chat calls now mark
org.springframework.ai.retry.NonTransientAiException and
java.lang.IllegalArgumentException non-retryable. Default options for
MCP calls mark IllegalArgumentException non-retryable. User-supplied
ActivityOptions pass through verbatim — the plugin does not augment
them.
- new ActivityChatModel(...) and new ActivityMcpClient(activity)
constructors are @deprecated with javadoc pointing at the factories —
they still work at runtime but skip the UI Summary labels the
plugin-owned stub path attaches, which is now called out explicitly.
- README: new "Activity options and retry behavior" section documents
the defaults, how to customize, and the Summary/factory connection.
- Tests: two new suites — ActivityOptionsAndRetryTest covers the
non-retryable classification (1 attempt for NonTransientAiException,
3 attempts for transient RuntimeException, custom task queue landing
on the scheduled activity); ActivitySummaryTest gains a regression
test asserting forDefault(customOptions) still emits UI Summaries.
- build.gradle: spring-ai-retry added as a testImplementation so tests
can reference NonTransientAiException directly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b3bb749 commit 2a76e4e
6 files changed
Lines changed: 445 additions & 23 deletions
File tree
- temporal-spring-ai
- src
- main/java/io/temporal/springai
- mcp
- model
- test/java/io/temporal/springai
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
Lines changed: 66 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
| |||
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
58 | 76 | | |
| 77 | + | |
| 78 | + | |
59 | 79 | | |
| 80 | + | |
60 | 81 | | |
61 | 82 | | |
62 | 83 | | |
| |||
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
75 | | - | |
| 96 | + | |
| 97 | + | |
76 | 98 | | |
77 | 99 | | |
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
81 | 103 | | |
82 | | - | |
| 104 | + | |
83 | 105 | | |
84 | 106 | | |
85 | 107 | | |
86 | | - | |
| 108 | + | |
| 109 | + | |
87 | 110 | | |
88 | 111 | | |
89 | 112 | | |
| |||
92 | 115 | | |
93 | 116 | | |
94 | 117 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
100 | 132 | | |
101 | 133 | | |
102 | 134 | | |
103 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
104 | 162 | | |
105 | 163 | | |
106 | 164 | | |
| |||
Lines changed: 95 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
86 | 100 | | |
87 | 101 | | |
88 | 102 | | |
| |||
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
95 | 114 | | |
| 115 | + | |
| 116 | + | |
96 | 117 | | |
| 118 | + | |
97 | 119 | | |
98 | 120 | | |
99 | 121 | | |
100 | 122 | | |
101 | 123 | | |
102 | 124 | | |
103 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
104 | 130 | | |
105 | 131 | | |
| 132 | + | |
| 133 | + | |
106 | 134 | | |
| 135 | + | |
107 | 136 | | |
108 | 137 | | |
109 | 138 | | |
| |||
123 | 152 | | |
124 | 153 | | |
125 | 154 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
130 | 158 | | |
131 | 159 | | |
132 | 160 | | |
133 | 161 | | |
134 | 162 | | |
135 | 163 | | |
136 | | - | |
| 164 | + | |
137 | 165 | | |
138 | 166 | | |
139 | 167 | | |
140 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
141 | 174 | | |
142 | | - | |
143 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
144 | 185 | | |
145 | 186 | | |
146 | 187 | | |
| |||
149 | 190 | | |
150 | 191 | | |
151 | 192 | | |
152 | | - | |
| 193 | + | |
153 | 194 | | |
154 | 195 | | |
155 | 196 | | |
156 | | - | |
| 197 | + | |
| 198 | + | |
157 | 199 | | |
158 | 200 | | |
159 | 201 | | |
| |||
163 | 205 | | |
164 | 206 | | |
165 | 207 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
171 | 225 | | |
172 | 226 | | |
173 | 227 | | |
174 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
175 | 255 | | |
176 | 256 | | |
177 | 257 | | |
| |||
0 commit comments