sync update from LAN repo (source master-nj @ 067eb808)

This commit is contained in:
gozeros committed 2026-11-10 14:04:09 +08:00
1 parent 1244fb1f2f
commit 1d5dd8fc90
182 files changed
+18973 -769

No files matched your search

@@ -928,6 +928,9 @@ async def start_run(
router) and ``[leader-timing] / [special-timing]`` (圆桌 leader/special).
"""
t_entry = time.perf_counter()
from app.gateway.analysis_projects import prepare_project_run
body, analysis_project = await prepare_project_run(body, thread_id, request)
bridge = get_stream_bridge(request)
run_mgr = get_run_manager(request)
run_ctx = get_run_context(request)
@@ -948,7 +951,7 @@ async def start_run(
effective_user_id = get_effective_user_id()
effective_run_scope = _resolve_run_scope(body, request, run_scope)
graph_input = normalize_input(body.input)
fixed_answer = await _find_fixed_answer(
fixed_answer = None if analysis_project else await _find_fixed_answer(
body=body,
request=request,
graph_input=graph_input,
@@ -1170,6 +1173,11 @@ async def start_run(
if value is not None and top_level_key not in body_context:
body_context[top_level_key] = value
merge_run_context_overrides(config, body_context or None)
if analysis_project:
# This key is deliberately absent from the public context whitelist.
# Only the validated project binding can supply the mode contract.
for key in ("configurable", "context"):
config.setdefault(key, {})["analysis_project"] = body.context["analysis_project"]
stream_modes = normalize_stream_modes(body.stream_mode)