fix: honor live scheduling revisions at dispatch

This commit is contained in:
lda
2026-09-09 19:53:12 +07:00 Verified
parent b7c5f4e0eb
commit ecb5a76b12
11 changed files with 134 additions and 27 deletions
+6 -6
View File
@@ -111,9 +111,9 @@ class WorkflowRunApi:
# allocate/freeze -> persist admission -> materialize view -> dispatch
# captured -> persist stopped. A failed durable admission never
# dispatches, and dispatch never re-resolves the deployment.
# TODO(T11): hold the single-owner admission lock around this sequence
# once scheduler ownership lands; manual recheck here is only
# deployment validation (no schedule/capacity/overlap yet).
# Manual runs intentionally do not consume scheduler capacity or
# participate in schedule overlap; scheduler-owned dispatch uses its
# separate ownership and admission protocol.
store = self._run_store()
run_id = store.allocate_run_id()
environment = create_pinned_environment(
@@ -129,9 +129,9 @@ class WorkflowRunApi:
max_steps=limits.max_steps,
)
materialize_admitted_view(store=store, admission=admission)
# TODO(T10): record a dispatch mark between materialize and execute so
# crash-after-dispatch (abandoned, failed without replay) is
# distinguishable from pending-dispatch (safe to dispatch later).
# Manual execution has no scheduler pending-dispatch marker. The
# scheduler path records that marker before handing a run to this API,
# while manual runs retain their existing synchronous lifecycle.
plan = raw_plan_from_artifact(admission.environment.root_artifact)
captured_tree = saved_subgraph_tree_from_snapshots(
admission.environment.child_artifacts