Skip to content

assistant run polling endless #1407

@anyerqi

Description

@anyerqi

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

client.beta.threads.runs.create_and_poll will run endless, when the status of run is imcomplete

the unnormal run info:

{
    "id": "run_t7khKpQ2vvQJAnO3mJcRa47Y",
    "object": "thread.run",
    "created_at": 1715252643,
    "assistant_id": "asst_7HoUHfUXf8KPJQaetjN5suKP",
    "thread_id": "thread_9JfoNfFWttmyx9GSHVi6T9Gd",
    "status": "incomplete",
    "started_at": 1715252644,
    "expires_at": null,
    "cancelled_at": null,
    "failed_at": null,
    "completed_at": 1715252648,
    "required_action": null,
    "last_error": null,
    ......
    "max_completion_tokens": null,
    "max_prompt_tokens": null,
    "truncation_strategy": {
        "type": "auto",
        "last_messages": null
    },
    "incomplete_details": {
        "reason": "max_prompt_tokens"
    },
}

To Reproduce

  1. use file search tools: tools=[{"type": "file_search"}]
  2. trigger the limitation of max_prompt_tokens

Code snippets

No response

OS

ubuntu

Python version

Python 3.10.12

Library version

openai v1.26.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions