Operational coordination
AgentPlat provides an opt-in durable coordination loop for persisted Room messages and accepted AgentPlat Handoffs. Coordination selects and executes eligible work; it does not bypass Room policy or grant tool and effect authority.
Transactional intake
With RoomServiceOptions.automaticCoordination enabled, RoomService commits
the message, its domain event and the initial coordination item through one
repository transaction. A rollback cannot leave a visible message without its
corresponding coordination work.
Routing is provider-neutral and deterministic:
- resolve explicit participant references;
- consult an injected router constrained to eligible agent participants;
- use a declared default participant.
A routing decision is only a selection. Task creation, runtime execution, tools and external effects retain their own policy boundaries.
Worker model
AgentRoomCoordinationWorker discovers ready work by Room scope and provides:
- bounded concurrency and wakeup;
- leased claims and heartbeat renewal;
- compare-and-set revision fencing;
- classified failures and bounded exponential retry;
- stable operation IDs across retries and process restarts;
- queue metrics and graceful drain.
The default execution adapter converts one stable coordination operation into a deterministic Room task and policy-checked run. It fixes the published agent revision, opens the execution session after the durable run claim and before provider dispatch, and reconciles terminal execution and Handoff state.
Workflow engines
@agentplat/rooms-temporal is an optional durable-workflow adapter. Temporal
provides wakeup, retry, signals and history rollover while the canonical
coordination runtime and PostgreSQL stores remain authoritative. Workflow
history is not a second Room aggregate and cannot grant domain authority.
Applications may instead run the in-process worker or implement another adapter that preserves the same leases, fencing, stable identity and authority boundaries.