Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/ai/src/ai/modules/task/task_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,13 @@ async def stop_task(self, token: str):

# Only terminate tasks that were launched or executed directly
if control.launch_type in (LAUNCH_TYPE.LAUNCH, LAUNCH_TYPE.EXECUTE):
# Stop the inner task first so its state-transition monitor can
# still find this control in _task_control while the busy-wait
# in task_engine.stop_task() polls for COMPLETED/CANCELLED.
await control.task.stop_task()
# Free the slot so a subsequent use() with the same token does
# not race against a phantom registry entry.
self._task_control.pop(token, None)
self.debug_message(f'Task "{control.id}" stopped on request')

except Exception as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('RocketRideClient Integration Tests', () => {
expect(Object.values(TASK_STATE)).toContain(status!.state);

await client.terminate(result.token);
}, 90000);
}, TEST_CONFIG.timeout);

it(
'should terminate a pipeline',
Expand Down
Loading