From 60b32513cf2321299628bbb847d0faf3c1346ce9 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 15 Jun 2026 22:55:14 +0200 Subject: [PATCH] Update workflow runtime logic to correctly prepend compatibility context blocks when RAG or Web features are enabled --- backend/agent/runtime.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/agent/runtime.py b/backend/agent/runtime.py index 5543e6e..7153b2c 100644 --- a/backend/agent/runtime.py +++ b/backend/agent/runtime.py @@ -173,12 +173,16 @@ class WorkflowRuntime: raise RuntimeError("Workflow exceeded maximum_llm_calls.") try: - if selection_mode == "direct": + if ( + selection_mode == "direct" + or run_values.get("compatibility_rag_enabled") + or run_values.get("compatibility_web_enabled") + ): existing_context_blocks = list(run_values.get("context_blocks") or []) compatibility_context_blocks = await self._prepare_compatibility_context( run_id, workflow_id, run_values, workflow_inputs, writer, cancellation_event, counters, consume_llm_call ) - run_values["context_blocks"] = [*existing_context_blocks, *compatibility_context_blocks] + run_values["context_blocks"] = [*compatibility_context_blocks, *existing_context_blocks] await asyncio.wait_for( self._execute_graph( run_id, workflow_id, session_id, selection_mode, graph, values, node_outputs,