[GH-ISSUE #21961] bug: Chat title not generated when first message is cancelled and retried #106623

Closed
opened 2026-05-18 05:04:11 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @Plutarch01 on GitHub (Feb 28, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21961

Describe the bug

When a user cancels the AI response to the first message in a new chat, and then sends another message (or re-sends the same one), the chat title is never auto-generated. The chat remains stuck as "New Chat" indefinitely, even after subsequent messages complete successfully.

Steps to reproduce

  1. Create a new chat.
  2. Send a message to the AI.
  3. Before the response finishes, click the Stop/Cancel button to abort the response.
  4. Send another message (or re-send the original one).
  5. Wait for the response to complete successfully.

Expected behavior

The chat title should be auto-generated based on the first successful exchange, even if the first response attempt was cancelled and retried.

Actual behavior

The chat title remains "New Chat". No title generation task is triggered for the retry or any subsequent message.

Root cause (analysis)

Title generation in OpenWebUI is triggered inside the POST /api/chat/completed callback, which only fires when a chat exchange finishes normally. When the first message's response is cancelled, chat/completed never fires for it, so the title generation task is never scheduled.

When the user retries, OpenWebUI appears to treat subsequent messages as "not the first message" (the cancelled exchange still exists in the message history, even with an empty assistant response), so the title generation condition is not met again.

Environment

  • OpenWebUI version: latest (self-hosted)
  • Deployment: Docker

Suggested fix

Consider triggering title generation on the first successful chat/completed event, rather than strictly the first message. Alternatively, detect that the existing title is still the default ("New Chat") on each chat/completed and generate a title if it hasn't been set yet.

Originally created by @Plutarch01 on GitHub (Feb 28, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/21961 ## Describe the bug When a user cancels the AI response to the **first message** in a new chat, and then sends another message (or re-sends the same one), the chat title is never auto-generated. The chat remains stuck as **"New Chat"** indefinitely, even after subsequent messages complete successfully. ## Steps to reproduce 1. Create a new chat. 2. Send a message to the AI. 3. **Before the response finishes**, click the Stop/Cancel button to abort the response. 4. Send another message (or re-send the original one). 5. Wait for the response to complete successfully. ## Expected behavior The chat title should be auto-generated based on the first successful exchange, even if the first response attempt was cancelled and retried. ## Actual behavior The chat title remains "New Chat". No title generation task is triggered for the retry or any subsequent message. ## Root cause (analysis) Title generation in OpenWebUI is triggered inside the `POST /api/chat/completed` callback, which only fires when a chat exchange finishes normally. When the **first** message's response is cancelled, `chat/completed` never fires for it, so the title generation task is never scheduled. When the user retries, OpenWebUI appears to treat subsequent messages as "not the first message" (the cancelled exchange still exists in the message history, even with an empty assistant response), so the title generation condition is not met again. ## Environment - OpenWebUI version: latest (self-hosted) - Deployment: Docker ## Suggested fix Consider triggering title generation on the first **successful** `chat/completed` event, rather than strictly the first message. Alternatively, detect that the existing title is still the default ("New Chat") on each `chat/completed` and generate a title if it hasn't been set yet.
Author
Owner

@pr-validator-bot commented on GitHub (Feb 28, 2026):

⚠️ Missing Issue Title Prefix

@tsachig, your issue title is missing a prefix (e.g., bug:, feat:, docs:).

Please update your issue title to include one of the following prefixes:

  • bug: Bug report or error you've encountered
  • feat: Feature request or enhancement suggestion
  • docs: Documentation issue or improvement request
  • question: Question about usage or functionality
  • help: Request for help or support

Example: bug: Login fails when using special characters in password

<!-- gh-comment-id:3977161616 --> @pr-validator-bot commented on GitHub (Feb 28, 2026): # ⚠️ Missing Issue Title Prefix @tsachig, your issue title is missing a prefix (e.g., `bug:`, `feat:`, `docs:`). Please update your issue title to include one of the following prefixes: - **bug**: Bug report or error you've encountered - **feat**: Feature request or enhancement suggestion - **docs**: Documentation issue or improvement request - **question**: Question about usage or functionality - **help**: Request for help or support Example: `bug: Login fails when using special characters in password`
Author
Owner

@Classic298 commented on GitHub (Mar 2, 2026):

might be fixed by https://github.com/open-webui/open-webui/pull/22153

testing wanted

<!-- gh-comment-id:3986025390 --> @Classic298 commented on GitHub (Mar 2, 2026): might be fixed by https://github.com/open-webui/open-webui/pull/22153 testing wanted
Author
Owner

@Classic298 commented on GitHub (Mar 6, 2026):

@tsachig testing still wanted

<!-- gh-comment-id:4013454814 --> @Classic298 commented on GitHub (Mar 6, 2026): @tsachig testing still wanted
Author
Owner

@Plutarch01 commented on GitHub (Mar 6, 2026):

Apologies - I am away from my OpenWebUI instance and unable to reach it remotely. I will not be able to address the request until March 20th.

<!-- gh-comment-id:4014354956 --> @Plutarch01 commented on GitHub (Mar 6, 2026): Apologies - I am away from my OpenWebUI instance and unable to reach it remotely. I will not be able to address the request until March 20th.
Author
Owner

@tjbck commented on GitHub (Mar 7, 2026):

Intended behaviour, you can manually trigger title generation.

<!-- gh-comment-id:4017662027 --> @tjbck commented on GitHub (Mar 7, 2026): Intended behaviour, you can manually trigger title generation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#106623