From 6a7d281121e3ffe9bb1d024b60f08c02e13cf5c0 Mon Sep 17 00:00:00 2001 From: hector Date: Wed, 28 Jan 2026 13:07:52 +0100 Subject: [PATCH] fix: resolve pipeline reload module caching issue --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index e277d3a3..f88d2a5b 100644 --- a/main.py +++ b/main.py @@ -23,9 +23,9 @@ import importlib.util import logging import time +import sys import json import uuid -import sys import subprocess @@ -150,6 +150,12 @@ async def load_module_from_path(module_name, module_path): install_frontmatter_requirements(frontmatter["requirements"]) # Load the module + # Clear module from sys.modules cache to ensure fresh reload + # This fixes the issue where pipeline reload API would return 200 but + # continue using cached module code instead of reloading updated files + if module_name in sys.modules: + del sys.modules[module_name] + spec = importlib.util.spec_from_file_location(module_name, module_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module)