From 7b884c4a24732027eb38a4865f339e64294bdafe Mon Sep 17 00:00:00 2001 From: Zaki Date: Sun, 22 Mar 2026 19:00:05 -0700 Subject: [PATCH] fix(routines): propagate job_id to notification metadata (#1321) Update run.job_id after execute_full_job() links the routine run to the job, ensuring send_notification receives the actual job ID instead of None on the normal completion path. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/agent/routine_engine.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agent/routine_engine.rs b/src/agent/routine_engine.rs index c19092a6..8365b010 100644 --- a/src/agent/routine_engine.rs +++ b/src/agent/routine_engine.rs @@ -1086,7 +1086,7 @@ struct EngineContext { } /// Execute a routine run. Handles both lightweight and full_job modes. -async fn execute_routine(ctx: EngineContext, routine: Routine, run: RoutineRun) { +async fn execute_routine(ctx: EngineContext, routine: Routine, mut run: RoutineRun) { // Increment running count (atomic: survives panics in the execution below) ctx.running_count.fetch_add(1, Ordering::Relaxed); @@ -1255,7 +1255,7 @@ struct FullJobExecutionConfig<'a> { async fn execute_full_job( ctx: &EngineContext, routine: &Routine, - run: &RoutineRun, + run: &mut RoutineRun, execution: &FullJobExecutionConfig<'_>, ) -> Result<(RunStatus, Option, Option), RoutineError> { match ctx.sandbox_readiness {