Stuck at Cancelling Thread AoAi Assistants

Mohamed Hussein 710 Reputation points
2025-01-03T23:03:03.3533333+00:00

Good Day,

I've been stuck for 30 minutes getting this error,

Any workaround to force terminate the thread? especially those with pending on external tools/ functions

{ "error": { "message": "Cannot cancel run with status 'cancelling'.", "type": "invalid_request_error", "param": null, "code": null } }

https://huswabagpt.openai.azure.com/openai/threads/thread_7j2hL1FVVVLQfi9plDS714to/runs/run_pZnf7VsPSCg0FtgNjC43heML/cancel?api-version=2024-08-01-preview

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,118 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Saideep Anchuri 9,500 Reputation points Moderator
    2025-01-06T04:23:37.1+00:00

    Hi Mohamed Hussein

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    I understand that you are encountering an issue, if it has been executed using threads with the REST API or SDK v1, it can be cancelled. Else, it can be deleted using either the REST API or Python SDK v1.

    Kindly refer below documentation: https://learn.microsoft.com/en-us/azure/ai-services/openai/assistants-reference-runs?tabs=python#cancel-a-run

    https://learn.microsoft.com/en-us/azure/ai-services/openai/assistants-reference-threads?tabs=rest#delete-thread

    Please create a support ticket if above methods does not work as it might be a server-side issue too.

    Thank You.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.