feat(integration): wire v2 workstreams together (engine policy/budget, sandbox, tenant checks, order route, docs)
Engine honours org policy and monthly budget, legacy runner skips engine tasks, sandbox session provisioned on demand, project fallback for threads, reviewer fallback, tenant checks on project ids, memory reflection respects grants, expiry worker, MCP pipeline_status, login redirect, sharing settings, e2e smoke. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
36564e3f2b
commit
fef5a9deab
@@ -52,7 +52,7 @@ class AiRuntimeWorker:
|
||||
|
||||
async with worker_session() as session:
|
||||
await self._drain_runs(session, outcome, limit=limit)
|
||||
await self._tick_engine(session, outcome, limit=limit)
|
||||
await self._tick_engine(session, outcome)
|
||||
|
||||
return outcome
|
||||
|
||||
@@ -116,7 +116,7 @@ class AiRuntimeWorker:
|
||||
message=f"کار «{current.title}» در حال اجراست (اجرا {run.id}).",
|
||||
)
|
||||
|
||||
async def _tick_engine(self, session, outcome: WorkerOutcome, *, limit: int) -> None:
|
||||
async def _tick_engine(self, session, outcome: WorkerOutcome) -> None:
|
||||
"""One scheduler tick: move every ready task one step.
|
||||
|
||||
A tick failure is recorded against the worker and the pass ends — the
|
||||
@@ -125,7 +125,10 @@ class AiRuntimeWorker:
|
||||
"""
|
||||
try:
|
||||
scheduler = build_scheduler(session)
|
||||
report = await scheduler.tick(limit=max(limit, 10))
|
||||
# A wide read: states that cannot run this pass (automation off, or nobody free
|
||||
# for their stage) must not fill the window and starve the other organizations.
|
||||
# Scheduler._select still bounds the real work per organization and per pass.
|
||||
report = await scheduler.tick(limit=500)
|
||||
except Exception as exc: # noqa: BLE001 - a worker must survive a bad tick
|
||||
outcome.failed += 1
|
||||
outcome.note(f"engine tick: {type(exc).__name__}: {exc}")
|
||||
|
||||
Reference in New Issue
Block a user