Commit f19bf23
committed
fix: poll through CANCELING state to deliver terminal callback
The _poll_for_completion thread exited the polling loop as soon as
the session state transitioned away from RUNNING. When cancel_action()
is called, the pyo3 binding immediately sets the snapshot state to
CANCELING — causing the poller to exit before the subprocess has been
killed and before the Rust callback delivers the terminal CANCELED
ActionStatus.
The result: the worker agent never receives the CANCELED callback,
leaving the action stuck in CANCELING forever from the service's
perspective.
Fix: treat CANCELING as an in-progress state (like RUNNING) and
continue polling. The poller now exits only when the state reaches
READY or READY_ENDING, at which point action_status contains the
correct terminal state.
Signed-off-by: Sean Tang <seant-aws@users.noreply.github.com>
Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com>1 parent 36e85fb commit f19bf23
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
0 commit comments