77from oc_orchestrator.work_queue
import QueueBackend, QueueBackendError
96 """Build the registry-backed queue (plan 271 P2's consumer factory).
98 Lifted verbatim from the registry arm of the pre-271
99 ``work_queue_manage._build_backend``. The package declares the seam
100 and names no registry; this is the consumer that fills it, so the
101 four imports the plan-258 receipt cut as a named edge now live on
102 oc_chat's side of the split, where they always belonged.
105 QueueBackendError: EXTERNAL_ERROR (L2 for the caller) — the
106 registry holds no active operator slot, so there is no actor
107 to attribute the operations to.
109 func =
"_registry_backend"
118 location = discover_registry_location(registry_path=args.registry)
119 storage = SQLiteBackend(location.registry_path)
120 actor_slot = args.actor_slot
or storage.active_operator_slot()
121 if actor_slot
is None:
122 raise QueueBackendError(
"no active operator slot found in the registry")
123 _dbg(
"OC_CHAT.MAIN", func, f
"registry backend as {actor_slot}", 2)
124 return RegistryQueueBackend(
126 slot=args.slot
or actor_slot,
127 actor_slot=actor_slot,