mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 12:58:11 -05:00
[PR #9095] [CLOSED] **fix** Fix title generation JSON enforcement changes #22316
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/9095
Author: @joshuawu
Created: 1/30/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (1)
bcaf405Fix title generation JSON enforcement changes📊 Changes
2 files changed (+3 additions, -5 deletions)
View changed files
📝
backend/open_webui/routers/tasks.py(+2 -4)📝
backend/open_webui/utils/middleware.py(+1 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Fix bug where task would crash if it generated a summary without strict JSON format.
However, this only mitigates the root issue: see Additional Information.
Added
Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
The cause of the new issue is due to the new change to enforce a strict JSON response when generating titles.
This fix only prevents the generation task from crashing. It simply ignores the bad response and falls back to the chat history.
Screenshots or Videos
Example of query failure
This is an easy way to get title generation to fail:


Which produces the fallback title:
(Note: The issue is with the title generation response, not directly the initial response above.)
Also, I've seen it fail even with more unrelated prompts like topics about medicine, science, or history. With many models, sometimes the model disobeys and uses Markdown instead of JSON. An example was
**Title:** 💊 Health and MedicineFor further context, earlier I suggested having an explicit setting for chain of thought models (see the closed PR https://github.com/open-webui/open-webui/pull/9088), but it was not preferred.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.