fix: merge initial context during update workflow run

This commit is contained in:
Abhishek Kumar 2026-06-18 09:25:02 +05:30
parent d2cda85b78
commit 7efc19c812

View file

@ -376,7 +376,12 @@ class WorkflowRunClient(BaseDBClient):
if cost_info: if cost_info:
run.cost_info = cost_info run.cost_info = cost_info
if initial_context: if initial_context:
run.initial_context = initial_context # Merge initial context patches so independent call-start/runtime
# writers do not erase keys stored earlier in the run lifecycle.
run.initial_context = {
**(run.initial_context or {}),
**initial_context,
}
if gathered_context: if gathered_context:
# Lets merge the incoming gathered context keys with the existing ones # Lets merge the incoming gathered context keys with the existing ones
run.gathered_context = { run.gathered_context = {