[PR #20585] [MERGED] fix: pass chat_id to internal task calls for consistent function context #113000

Closed
opened 2026-05-18 13:15:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20585
Author: @Classic298
Created: 1/11/2026
Status: Merged
Merged: 2/12/2026
Merged by: @tjbck

Base: devHead: fix/chat-id-internal-tasks


📝 Commits (1)

  • dcb11f3 fix: pass chat_id to internal task calls for consistent function context

📊 Changes

2 files changed (+12 additions, -5 deletions)

View changed files

📝 backend/open_webui/utils/middleware.py (+3 -0)
📝 src/lib/apis/index.ts (+9 -5)

📄 Description

Ensure chat_id is reliably passed to function pipelines/manifolds during internal task invocations (web search query generation, RAG query generation, image prompt generation).

This allows stateful functions to maintain per-chat state without fragmentation, as they will now receive a consistent chat_id for all chat-scoped invocations including internal tasks.

Backend changes:

  • Pass chat_id in generate_queries call for web search
  • Pass chat_id in generate_queries call for RAG/retrieval
  • Pass chat_id in generate_image_prompt call

Frontend changes:

  • Add optional chat_id parameter to generateQueries API function
  • Add optional chat_id parameter to generateAutoCompletion API function

Fixes #20563

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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/20585 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 1/11/2026 **Status:** ✅ Merged **Merged:** 2/12/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/chat-id-internal-tasks` --- ### 📝 Commits (1) - [`dcb11f3`](https://github.com/open-webui/open-webui/commit/dcb11f377d70b51802476089cf0303af8489b064) fix: pass chat_id to internal task calls for consistent function context ### 📊 Changes **2 files changed** (+12 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+3 -0) 📝 `src/lib/apis/index.ts` (+9 -5) </details> ### 📄 Description Ensure chat_id is reliably passed to function pipelines/manifolds during internal task invocations (web search query generation, RAG query generation, image prompt generation). This allows stateful functions to maintain per-chat state without fragmentation, as they will now receive a consistent chat_id for all chat-scoped invocations including internal tasks. Backend changes: - Pass chat_id in generate_queries call for web search - Pass chat_id in generate_queries call for RAG/retrieval - Pass chat_id in generate_image_prompt call Frontend changes: - Add optional chat_id parameter to generateQueries API function - Add optional chat_id parameter to generateAutoCompletion API function Fixes #20563 ### 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. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <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-05-18 13:15:15 -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#113000