diff --git a/cortex/routers/orchestrator.py b/cortex/routers/orchestrator.py index 536f9d9..330ccd3 100644 --- a/cortex/routers/orchestrator.py +++ b/cortex/routers/orchestrator.py @@ -105,7 +105,7 @@ async def orchestrate(req: OrchestrateRequest) -> OrchestrateResponse: _jobs[job_id] = job # Run in background — caller polls GET /orchestrate/{job_id} - asyncio.create_task(_run_job(job_id, req)) + asyncio.create_task(_run_job(job_id, req, user)) logger.info("Orchestrator job queued: %s — %.80s", job_id, req.task) return OrchestrateResponse(job_id=job_id, status="queued") @@ -135,7 +135,7 @@ async def list_jobs() -> list[JobStatusResponse]: # Background runner # --------------------------------------------------------------------------- -async def _run_job(job_id: str, req: OrchestrateRequest) -> None: +async def _run_job(job_id: str, req: OrchestrateRequest, user: str) -> None: """Execute the orchestration job and update the job store.""" async with _jobs_lock: _jobs[job_id]["status"] = "running"