From 5538240fac9ac355ff6e807e891b88667a4252c3 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Mon, 22 Jul 2024 02:56:58 +0530 Subject: [PATCH] add variables from the msg saved run to analysis run --- bots/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bots/tasks.py b/bots/tasks.py index 26fb71ff9..e6fd11152 100644 --- a/bots/tasks.py +++ b/bots/tasks.py @@ -67,8 +67,10 @@ def msg_analysis(self, msg_id: int, anal_id: int, countdown: int | None): analysis_sr = anal.get_active_saved_run() variables = analysis_sr.state.get("variables", {}) - # add the state variables requested by the script if msg.saved_run: + # add the variables from the parent run + variables |= msg.saved_run.state.get("variables") or {} + # add the state variables requested by the script fill_req_vars_from_state(msg.saved_run.state, variables) if "messages" in variables: variables["messages"] = messages_as_prompt(