Repository navigation
Commit 4a590b4
feat(durable): add wait_for_approval and the approvals client (#389)
* feat(api): sync durable approval operations
Regenerates the internal client from the Hosting spec with the durable approval request, list, get, stats, approve, and deny operations, and requires the operations the SDK calls.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(durable): add durable approvals
DurableContext.wait_for_approval registers an approval with Volcano from the runtime's callback submitter and suspends until a person decides. A denial or a timeout returns an ApprovalDecision rather than raising. @durable reads the execution reference from the invocation and passes it to child, map, and parallel contexts.
client.durable.approvals lists, reads, summarizes, approves, and denies approvals. HTTP 403 now raises PermissionDeniedError, a subclass of AuthenticationError.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(durable): bound approval registration retries and validate size
Retry registration on network errors, timeouts, 404, 429, any 5xx, and
409 approval_not_ready, on the JS SDK's delay schedule within one
30-second deadline that also caps each attempt's timeout. A 409
approval_closed now counts as registered, so an approval whose timeout
passed first resumes with the expired decision instead of failing the
execution.
Refuse text that cannot be encoded as JSON and approvals over 64 KiB
(with room for the longest callback id) before the callback opens, and
send the exact bytes that were measured. Out-of-range approval timeouts
raise TypeError, as ctx.wait does.
Correct the guide: approvals have no name filter, and a refusal reaches
the handler as the runtime's CallbackSubmitterError.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(durable): drop the approval retry delay the deadline never reaches
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(api): sync the durable approval description from hosting
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(durable): decide an approval by its status and read its details leniently
Co-authored-by: Cursor <cursoragent@cursor.com>
* perf(durable): build the runtime wrapper once and read the execution from its context
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(durable): end each approval registration attempt by its own deadline
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(durable): mock the API's own refusal for a project access token
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(durable): read decided_at only as an RFC 3339 date-time, as the JavaScript SDK does
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(durable): pin the approval answer cap and the retry deadline edge
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(durable): cover anchoring and range edges of the decision time
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(openapi): declare 413 on approval decisions
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(durable): refuse approval names and text the platform cannot record
Names are the runtime's operation name, so they hold to printable ASCII and 237 characters. NUL is refused before the callback opens, details are copied when checked, and a stalled host lookup no longer outlasts its attempt.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(durable): report the attempt's deadline when the client's timeout wins
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(realtime): give native commands two seconds to arrive
A command normally arrives within a millisecond. The 0.2 s wait failed the
cancelled-unsubscribe tests whenever a loaded runner stalled the loop, which
made mutation stats collection fail on random modules.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent b9f40bb commit 4a590b4
59 files changed
Lines changed: 8649 additions & 91 deletions
File tree
- docs
- openapi
- scripts
- src/volcano_sdk
- _generated
- api
- durable_functions
- frontends
- models
- _tests
- fixtures
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
267 | 285 | | |
268 | 286 | | |
269 | 287 | | |
| |||
332 | 350 | | |
333 | 351 | | |
334 | 352 | | |
| 353 | + | |
335 | 354 | | |
336 | 355 | | |
337 | 356 | | |
| |||
372 | 391 | | |
373 | 392 | | |
374 | 393 | | |
375 | | - | |
376 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
377 | 418 | | |
378 | 419 | | |
379 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 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 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
132 | 226 | | |
133 | 227 | | |
134 | 228 | | |
| |||
142 | 236 | | |
143 | 237 | | |
144 | 238 | | |
| 239 | + | |
| 240 | + | |
145 | 241 | | |
0 commit comments