Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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: 5 additions & 1 deletion packages/ai/src/ai/modules/task/task_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,11 @@ 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):
await control.task.stop_task()
# Route through the shared cleanup helper so the registry slot,
# monitor subscriptions, and the task_removed dashboard event are
# all handled consistently. Without this, a subsequent use() with
# the same token races against a phantom registry entry.
await self.remove_task(token)
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