[PR #22212] [MERGED] fix: correct conflicting output format in follow-up generation prompt template #49602

Closed
opened 2026-04-30 01:54:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22212
Author: @MJ16MJ
Created: 3/4/2026
Status: Merged
Merged: 3/6/2026
Merged by: @tjbck

Base: devHead: fix/follow-up-prompt-template-format


📝 Commits (1)

  • e53a478 fix: correct conflicting output format instruction in follow-up generation prompt

📊 Changes

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

View changed files

📝 backend/open_webui/config.py (+1 -1)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Verify that the pull request targets the dev branch.
  • Description: Provided below.
  • Changelog: Included below.
  • Testing: Verified the frontend parser expects { "follow_ups": [...] } format and confirmed the updated guideline now matches.
  • Agentic AI Code: This change has been manually reviewed and verified.
  • Code review: Self-reviewed.
  • Git Hygiene: Single atomic commit, one logical change.
  • Title Prefix: fix:

Changelog Entry

Description

The DEFAULT_FOLLOW_UP_GENERATION_PROMPT_TEMPLATE in backend/open_webui/config.py contained contradictory output format instructions:

  • Guidelines section said: "Response must be a JSON array of strings" (top-level array [...])
  • Output section said: { "follow_ups": ["Question 1?", ...] } (object with key)

The frontend parser in src/lib/apis/index.ts expects a JSON object — it searches for {/} delimiters and extracts parsed.follow_ups. When an LLM followed the "array" instruction and returned ["Q1?", "Q2?"], the parser found no {, returned [], and the UI showed no follow-up suggestions.

Fixed

  • Corrected the Guidelines instruction from "Response must be a JSON array of strings" to "Response must be a JSON object with a follow_ups key containing an array of strings" — now consistent with the Output section and frontend parser expectations.

Added

  • N/A

Changed

  • N/A

Deprecated

  • N/A

Removed

  • N/A

Security

  • N/A

Breaking Changes

  • N/A

Additional Information

Screenshots or Videos

N/A — this is a backend prompt template text fix with no UI changes.

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 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/22212 **Author:** [@MJ16MJ](https://github.com/MJ16MJ) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/6/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/follow-up-prompt-template-format` --- ### 📝 Commits (1) - [`e53a478`](https://github.com/open-webui/open-webui/commit/e53a478227f697120964ac82d0b5ba3cb7c295d5) fix: correct conflicting output format instruction in follow-up generation prompt ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+1 -1) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Verify that the pull request targets the `dev` branch. - [x] **Description:** Provided below. - [x] **Changelog:** Included below. - [x] **Testing:** Verified the frontend parser expects `{ "follow_ups": [...] }` format and confirmed the updated guideline now matches. - [x] **Agentic AI Code:** This change has been manually reviewed and verified. - [x] **Code review:** Self-reviewed. - [x] **Git Hygiene:** Single atomic commit, one logical change. - [x] **Title Prefix:** `fix:` # Changelog Entry ### Description The `DEFAULT_FOLLOW_UP_GENERATION_PROMPT_TEMPLATE` in `backend/open_webui/config.py` contained contradictory output format instructions: - **Guidelines** section said: *"Response must be a JSON array of strings"* (top-level array `[...]`) - **Output** section said: `{ "follow_ups": ["Question 1?", ...] }` (object with key) The frontend parser in `src/lib/apis/index.ts` expects a JSON **object** — it searches for `{`/`}` delimiters and extracts `parsed.follow_ups`. When an LLM followed the "array" instruction and returned `["Q1?", "Q2?"]`, the parser found no `{`, returned `[]`, and the UI showed no follow-up suggestions. ### Fixed - Corrected the Guidelines instruction from "Response must be a JSON array of strings" to "Response must be a JSON object with a `follow_ups` key containing an array of strings" — now consistent with the Output section and frontend parser expectations. ### Added - N/A ### Changed - N/A ### Deprecated - N/A ### Removed - N/A ### Security - N/A ### Breaking Changes - N/A --- ### Additional Information - Fixes #22187 - Single-line change in `backend/open_webui/config.py` (line 1963) - No behavioral changes to parsing logic — only the prompt template text is updated - Frontend parser reference: `src/lib/apis/index.ts:716-730` ### Screenshots or Videos N/A — this is a backend prompt template text fix with no UI changes. ### Contributor License Agreement 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-30 01:54:08 -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#49602