fix(scheduler): reuse one execution session per scheduled job

Reuse channel_session_v2 per job_id so cron runs do not create a new
oclaw session each time; isolate scheduled turn context to the active
turn_uuid so shared sessions do not leak prior run history.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-07-21 16:20:31 +08:00
parent 146d83c336
commit 4f36f4a36f
4 changed files with 53 additions and 24 deletions

View file

@ -46,7 +46,6 @@ def enqueue_scheduled_job_run(
store,
job=job,
created_by_user_id=str(getattr(job, "created_by_user_id", "") or ""),
run_id=str(run.id),
)
except Exception as exc:
store.scheduled_job_run_update(