Disable Jinja2 cache to fix hashing error

This commit is contained in:
Z User 2026-03-24 06:00:38 +00:00
parent 6b4a2fa31e
commit d3c0dfbf5b

View File

@ -21,7 +21,14 @@ from core.orchestrator import Orchestrator
router = APIRouter()
# Templates - use string path for better compatibility
templates = Jinja2Templates(directory=str(Path(__file__).parent / "templates"))
# Disable cache to avoid hashing issues with Pydantic objects
from jinja2 import Environment, FileSystemLoader
template_env = Environment(
loader=FileSystemLoader(str(Path(__file__).parent / "templates")),
autoescape=True,
cache_size=0, # Disable cache
)
templates = Jinja2Templates(env=template_env)
def get_template_settings():