Fix handler execution: inject page helpers into handler env
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled

component-source and handler-source are page helpers, not IO primitives.
They need to be in the handler evaluation env just like defpage evaluation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 02:31:52 +00:00
parent c440c26292
commit 78b4d0f1ac

View File

@@ -127,6 +127,7 @@ async def execute_handler(
4. Return ``SxExpr`` wire format
"""
from .jinja_bridge import get_component_env, _get_request_context
from .pages import get_page_helpers
import os
if os.environ.get("SX_USE_REF") == "1":
from .ref.async_eval_ref import async_eval_to_sx
@@ -139,6 +140,7 @@ async def execute_handler(
# Build environment
env = dict(get_component_env())
env.update(get_page_helpers(service_name))
env.update(handler_def.closure)
# Bind handler params from request args