Problem
When an agent is busy, a delegated turn needs a durable, inspectable queue instead of being lost, recursively delegated, or ambiguously accepted. Retry identity must be scoped to the source turn: retries from one turn should deduplicate, while a later identical request should remain distinct.
Required behavior
- Persist queue state as
openmaus.delegations.v2 with bounded attempts and age.
- Enforce one-hop delegation and strictly validate optional
depth as a safe integer in range.
- Generate and validate a
sourceRunId for every source turn, propagate it through the agents proxy, and include it in the stable task hash.
- Keep the response contract
{ state, taskId, duplicate, reason? } and terminal states completed | queued | failed.
- Contain every drain failure, terminalize the exact task with a fixed machine reason, continue the batch, and avoid unhandled promise rejection.
- Resolve dispatch only after provider submission and ownership marking succeed via a distinct
onDispatchAccepted callback, without weakening onDispatchError.
- Emit
delegation.status lifecycle events and expose redacted state in the inspector.
Acceptance
Cover malformed depth, same-turn deduplication, later-turn identity, busy wakeup, restart recovery, retry/age expiry, late dispatch failure, thrown-drain containment, approvals, one-hop behavior, metadata redaction, and existing direct/webhook/peer flows.
Run focused delegation/proxy/index tests, typecheck, build, and the repository test floor before publication.
Boundaries
This is source behavior only. It does not activate unattended work, restart a live runtime, change provider defaults, expose credentials, or bypass approval policy.
Problem
When an agent is busy, a delegated turn needs a durable, inspectable queue instead of being lost, recursively delegated, or ambiguously accepted. Retry identity must be scoped to the source turn: retries from one turn should deduplicate, while a later identical request should remain distinct.
Required behavior
openmaus.delegations.v2with bounded attempts and age.depthas a safe integer in range.sourceRunIdfor every source turn, propagate it through the agents proxy, and include it in the stable task hash.{ state, taskId, duplicate, reason? }and terminal statescompleted | queued | failed.onDispatchAcceptedcallback, without weakeningonDispatchError.delegation.statuslifecycle events and expose redacted state in the inspector.Acceptance
Cover malformed depth, same-turn deduplication, later-turn identity, busy wakeup, restart recovery, retry/age expiry, late dispatch failure, thrown-drain containment, approvals, one-hop behavior, metadata redaction, and existing direct/webhook/peer flows.
Run focused delegation/proxy/index tests, typecheck, build, and the repository test floor before publication.
Boundaries
This is source behavior only. It does not activate unattended work, restart a live runtime, change provider defaults, expose credentials, or bypass approval policy.