[PR #23386] [CLOSED] fix: query prompt tags by JSON elements #42806

Closed
opened 2026-04-25 14:36:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23386
Author: @suyua9
Created: 4/3/2026
Status: Closed

Base: devHead: suyua9-fix-prompt-tag-cyrillic


📝 Commits (1)

  • 4368cce fix: query prompt tags by JSON elements

📊 Changes

1 file changed (+18 additions, -5 deletions)

View changed files

📝 backend/open_webui/models/prompts.py (+18 -5)

📄 Description

Pull Request Checklist

  • Target branch: Verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request down below.
  • Changelog: No changelog entry needed for this small backend bug fix.
  • Documentation: No docs repo change needed for this backend query fix.
  • Dependencies: No new or upgraded dependencies.
  • Testing: I ran python3 -m py_compile backend/open_webui/models/prompts.py and git diff --check.
  • Agentic AI Code: I manually reviewed the final patch before opening this PR.
  • Code review: I performed a self-review of the code change.
  • Design & Architecture: The change only replaces the prompt tag filter query path with dialect-aware JSON element matching.
  • Git Hygiene: This PR is a single logical change based on dev.
  • Title Prefix: fix

Changelog Entry

Description

  • Use dialect-aware JSON element queries for prompt tag filtering so SQLite can match non-ASCII tags reliably.

Added

  • None.

Changed

  • Prompt tag filtering now queries decoded JSON array elements on SQLite and PostgreSQL instead of matching serialized JSON text.

Deprecated

  • None.

Removed

  • None.

Fixed

  • SQLite prompt tag filtering now returns prompts tagged with Cyrillic values such as Бизнес.

Security

  • None.

Breaking Changes

  • BREAKING CHANGE: None.

Additional Information

  • Refs [PR #14093] [MERGED] dev (#23381)
  • Manual verification:
    1. Inspect the existing query path in search_prompts() and confirm it previously lowercased serialized JSON text and used LIKE.
    2. Replace it with dialect-aware JSON element queries.
    3. Run python3 -m py_compile backend/open_webui/models/prompts.py and git diff --check.

Screenshots or Videos

  • Not applicable for this backend query fix.

Contributor License Agreement


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/23386 **Author:** [@suyua9](https://github.com/suyua9) **Created:** 4/3/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `suyua9-fix-prompt-tag-cyrillic` --- ### 📝 Commits (1) - [`4368cce`](https://github.com/open-webui/open-webui/commit/4368cce6bf6da6411f561d4e081553f6a2b2b31e) fix: query prompt tags by JSON elements ### 📊 Changes **1 file changed** (+18 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/prompts.py` (+18 -5) </details> ### 📄 Description # Pull Request Checklist - [x] **Target branch:** Verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request down below. - [ ] **Changelog:** No changelog entry needed for this small backend bug fix. - [ ] **Documentation:** No docs repo change needed for this backend query fix. - [x] **Dependencies:** No new or upgraded dependencies. - [x] **Testing:** I ran `python3 -m py_compile backend/open_webui/models/prompts.py` and `git diff --check`. - [x] **Agentic AI Code:** I manually reviewed the final patch before opening this PR. - [x] **Code review:** I performed a self-review of the code change. - [x] **Design & Architecture:** The change only replaces the prompt tag filter query path with dialect-aware JSON element matching. - [x] **Git Hygiene:** This PR is a single logical change based on `dev`. - [x] **Title Prefix:** `fix` # Changelog Entry ### Description - Use dialect-aware JSON element queries for prompt tag filtering so SQLite can match non-ASCII tags reliably. ### Added - None. ### Changed - Prompt tag filtering now queries decoded JSON array elements on SQLite and PostgreSQL instead of matching serialized JSON text. ### Deprecated - None. ### Removed - None. ### Fixed - SQLite prompt tag filtering now returns prompts tagged with Cyrillic values such as `Бизнес`. ### Security - None. ### Breaking Changes - **BREAKING CHANGE**: None. --- ### Additional Information - Refs #23381 - Manual verification: 1. Inspect the existing query path in `search_prompts()` and confirm it previously lowercased serialized JSON text and used `LIKE`. 2. Replace it with dialect-aware JSON element queries. 3. Run `python3 -m py_compile backend/open_webui/models/prompts.py` and `git diff --check`. ### Screenshots or Videos - Not applicable for this backend query fix. ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 14:36:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#42806