mirror of
https://github.com/open-webui/pipelines.git
synced 2026-11-05 01:37:24 +00:00
[PR #592] fix: resolve pipeline reload module caching issue #480
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/pipelines#480
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/pipelines/pull/592
Author: @hectorc98
Created: 1/28/2026
Status: 🔄 Open
Base:
main← Head:fix/pipeline-reload-module-caching📝 Commits (1)
6a7d281fix: resolve pipeline reload module caching issue📊 Changes
1 file changed (+7 additions, -1 deletions)
View changed files
📝
main.py(+7 -1)📄 Description
Fix: Pipeline Reload Module Caching Issue
Problem
The pipeline reload API (
POST /pipelines/reload) was returning HTTP 200 responses but not actually reloading updated pipeline code. Users had to restart the entire pod to see pipeline changes take effect, which defeats the purpose of the reload functionality.Root Cause
Python's module import system caches modules in
sys.modulesby name. Whenload_module_from_path()was called during pipeline reload:importlib.util.spec_from_file_location()would create a module specspec.loader.exec_module()would execute the modulesys.modules, Python would return the cached version instead of re-executing the updated file contentThis meant that pipeline code changes were read from disk but the cached module code continued to execute.
Solution
Added
sys.modulescache clearing inload_module_from_path()before loading modules:Impact
/pipelines/reloadTesting
load_module_from_path()functionFiles Changed
main.py: Addedsys.modulescache clearing and documentationValidation Steps
POST /pipelines/reloadThis fix resolves a significant development experience issue where pipeline changes appeared to be ignored by the reload API.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.