Commit d757b59
committed
Heartbeat every 30s while waiting on the approval workflow
The approval handler blocks on handle.result for as long as the
operator takes to decide. AgenticSession only heartbeats between LLM
turns, so a multi-hour wait inside this handler would trigger
heartbeat timeout (default 120s) and kill the activity.
Spawn a Thread that calls Temporalio::Activity::Context.current.heartbeat
every 30s, joined in ensure when handle.result returns. Survives
realistic operator delays.
Existing tests still pass.1 parent 0c822ed commit d757b59
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
289 | 307 | | |
290 | 308 | | |
0 commit comments