One more "Run failed" case

I know, it comes up again and again, since it seems there is an general issue a lot of developers are facing, and i guess we all want it to be fixed, so here we go again…

Run failed
Sorry, something went wrong

The following log is copy & paste from the OpenAI Dashbord → Assistants → Threads page, where i have a lot of threads like this, working ones and failing ones as well.

The second user question (or second chat message) causes the “Run failed,” but it’s completely random, sometimes it works as expected, sometimes it ends with “Run failed”. Sometimes it even fails, when i use that specific second question as first question, without a previous “hallo”. But it becomes a real issue, when it happens in an ongoing thread. If developers from OpenAI need more such data, i have tons of conversations like this, where it randomly works and sometimes not. I can also share more data (like used tools; the Assistant has 8 tools defined), but i would prefer to share them more privately. But if it helps to fix this issue, well…

The instructions work in general fine, i have written me an auto-chat, that takes a list of questions and runs the chat (ca. 120 questions for some specific FAQ data), and i run it regularly to make sure, my ChatService works fine (and, when it works, it’s also fun to watch it doing its thing), and i’m running out of ideas, because it doesn’t as it should…

I’m trying all the time to fix the issue somehow in my script via “fallbacks” and “fallbacks” for “fallbacks”, but no chance. There is this weird second question, that fails even in a row, but as you can see in the logs, the thread is not “dead,” it can be resumed. But not with the question, that caused the “Run fail.” But what causes this issue in the first place?

The last Assistant response is also interesting, because it contains the answer for the prior failed question, and the additional new data, that was requested in the last user question.

Does this also happens in the new Responses-API? I haven’t tried it so far, since i unfortunately rely on the Onboard-history of Assistants.

Thread

Created: 3/28/2025, 8:03 AM
Length: 6 messages
Tokens: 13248 · 12958 in, 290 out
File Search stores: None
Code interpreter files: None
Metadata: None
Messages:

User
Mar 28, 2025, 8:06 AM
hallo

Run instructions

You are a customer support chatbot in a Shopware web shop environment. Follow these guidelines to answer customer questions effectively.

Rules:
- Language: Respond only in the same language as the user's query.
- HTML Responses:
    - Always format responses using HTML elements such as <h2>, <p>, <a>, <img>, <b>, and <ul>.
    - If product search, use one <ul> element and put all products in that <ul> and always include the product URL, as we incorporate your response into a template.
    - Feel free to re-order or shorten search results as needed—making it as easy as possible for the customer is the top priority.
    - Use <b> elements to highlight key names. Use additional title for complex responses involving more than a sentence.
- Clickable Content:
    - Use <a> elements for URLs, paths, emails, and phone numbers to ensure they are easy to read and clickable.
- No Invented Information:
    - Do not invent URLs or any information of any kind. Use provided functions like `search_logs()`, `get_meta_information()` and `get_product_properties()` to retrieve accurate information.
    - Use the function `search_logs()` with valid tags from `tags_for_logs()` and queries to check, if the information you need is available there.
    - If a question cannot be answered, say sorry and explain the possible reason why.
- Initial Data Retrieval:
    - Determine the "request_type": ["information_gathering"|"product_search"|"product_recommendation"]
    - If the request_type is "product_search" or "product_recommendation":
        - Call `get_product_properties()` first to retrieve the shop's categories, properties, and manufacturer names.
- Product Recommendations:
    - For general advice or recommendations without specific product details in the user query, use data retrieved from `get_product_properties()` to tailor your advice with accurate properties and categories for the current query.
- Property Names:
    - Always use the exact property and category names retrieved from `get_product_properties()` as arguments in `product_search()`.
    - They must match exact to ensure accurate search results.

Log & Search Logs:
**Log & Search Logs have high Priority**
- The tools named `tags_for_logs()`, `search_logs()`, and `log()` are all interdependent.
    - The tool `search_logs()` allows you to search for answers in logs issued by assistants with the `log()` tool.
    - Logs issued with the `log()` tool are tagged with tags from the `tags_for_logs()` tool.
- Logs contain answers for information gaps issued by assistants with the `log()` tool.
- The tools are used as mini-API for a shared knowledge database managing shop related information and fallback data.
- Use the `search_logs()` tool for a quick search for specific information.
    - Search logs with a refined term or terms before anything else.
        - Most of the shop related information is stored here.
        - It is the fastest way to find information.
    - Call `tags_for_logs()` before you search to retrieve the latest tags that are allowed to use (tagNames).
        - If one or more of the tags matches the search, set them as arguments, too.
    - Allowed characters for tags are letters, numbers, and underscores.
    - Always avoid whitespace and special characters in tagNames.
    - Tags are always lowercase.

---

Product Search:
- Initial Data Retrieval: If not done yet, call `get_product_properties()` to get categories, properties, and manufacturer names.
- User Query Analysis:
    - Detect and differentiate between categories and properties in the user query.
    - Use retrieved categories and properties from `get_product_properties()` to match the query.
    - Ensure that categories and properties set in `product_search()` are written exactly as they are given in `get_product_properties()`.
    - Always try to set relevant categories as filters in `product_search()`, even if the user query does not specify them explicitly.
    - If a category name corresponds to multiple distinct categories, include all matching categories in `product_search()`.
    - Include all categories that closely match or are relevant to the query to exclude unnecessary products.
    - Remove categories and properties from the query before processing to avoid search failures.

---

Response:
- Responses should be formatted as JSON object only.
- The value for "output" can contain any content.
    - To improve readability, HTML or new lines should preferably be used.
- Use the following structure for the JSON Object response.
    - "output", "request_type", and "request_status" are required and must have content.
    - "error_occured" and "information_gap" are additional array fields.
    - If an error occures, write a brief description (or many) about the error.
    - If you encounter any "information_gap", write a brief description (or many) about the gap.
        - Log the information gap additionally
    - Format the final response as valid JSON Object.
        - Valid JSON means, no characters before and after the JSON Object allowed.

{
    "output": "OUTPUT",
    "request_type": ["information_gathering"|"required_action"],
    "request_status": ["ok|in_progress|failed"],
    "information_gap": ["INFORMATION_GAPS"],
    "error_occured": ["ERRORS"]
}

---

Generic HTML Example for Chat Messages

<div class="fel-oai-response">
    <a href="[tel|mailto|null]:URL">LABEL</a>
    <p>MESSAGE</p>
    <ul>
        <li>MESSAGES</li>
    </ul>
</div>

---

Generic Function Call... (some "Few-shot learning" examples)

(ASSISTANT) Enhanced Assistant 2.0

{
  "output": "<p>Hallo! Wie kann ich Ihnen helfen?</p>",
  "request_type": [
    "information_gathering"
  ],
  "request_status": [
    "ok"
  ],
  "information_gap": [],
  "error_occured": []
}

User
Mar 28, 2025, 8:28 AM
Gibt es ein Ladengeschäft? Wo befindet es sich?

  • Run failed
  • Sorry, something went wrong.

User
Mar 28, 2025, 8:30 AM
Gibt es ein Ladengeschäft? Wo befindet es sich?

  • Run failed
  • Sorry, something went wrong.

User
Mar 28, 2025, 8:31 AM
Wo finde ich die AGBs?

  • (ToolCall) get_meta_information({})
    Mar 28, 2025, 8:31 AM
    Allgemeine Fragen und AGB’s …

  • (ToolCall) tags_for_logs({})
    Mar 28, 2025, 8:31 AM
    { “tags”: [ “bug_report”, “category_related”, “feature_request”, “miscellaneous”, “performance”, “urgent” ], “_meta_data”: { “request_took”: “0.0015 sec” } }

(ASSISTANT) Enhanced Assistant 2.0

{
  "output": "<h2>Informationen zu unserem Ladengeschäft und den AGBs</h2><p>Ja, wir betreiben ein Ladengeschäft in ...:</p><p><b>Adresse:</b><br>Web Boutique<br>Musterstr 1<br>123456 earth</p><p><b>Öffnungszeiten:</b><br>Mo: geschlossen<br>Di-Fr: 10:00-12:30 Uhr, 14:00-18:30 Uhr<br>Sa: 10:00-16:00 Uhr</p><p>Die AGBs finden Sie hier: <a href=\"https://example.com\">AGBs</a></p>",
  "request_type": [
    "information_gathering"
  ],
  "request_status": [
    "ok"
  ],
  "information_gap": [],
  "error_occured": []
}