Repository navigation
Closed
Labels
Description
Objective
Prove the shared conversation turn workflow by migrating scheduled/plugin agent-dispatch onto it and deleting the independent dispatch execution lifecycle.
agent-dispatch is the existing second durable agent runtime: it currently owns a dispatch record version, attempt counter, slice lease, callback loop, incomplete-work index, heartbeat recovery, continuation scheduling, delivery guard, and terminalization path.
Scope
- Keep the dispatch record only for plugin-facing idempotency, request metadata, status, and result projection.
- Append each dispatch input to the normal conversation mailbox with a stable idempotency key.
- Before acknowledging that mailbox input, persist a small dispatch/task reference plus the exact actor, credential subject, execution destination, and completion behavior required to restore later slices.
- Execute new and resumed dispatch turns under the normal conversation lease and worker decision loop from Unify new and resumed turns in the conversation worker #876.
- Preserve the dispatch actor, credential subject, source, destination authority, visibility, configuration, tool context, isolated conversation identity, and stable turn identity.
- Preserve existing Slack completion behavior while expressing it as a completion target of the shared turn workflow.
- Recover timeout, worker loss, queue redelivery, and missing wakes through conversation execution.
- Remove dispatch-owned execution status/lease authority, callback continuation loop, incomplete index, and core heartbeat recovery after parity.
- Keep plugin heartbeat responsible only for discovering/scheduling plugin work.
Completion
- Dispatch input is durable mailbox work before a queue wake is sent.
- After mailbox acknowledgement, a later execution slice can restore dispatch authority and completion behavior from
conversationIdplus durable active-turn state; callback payloads are not runtime context. - Provider-backed conversations and dispatches use the same lease, start/resume decision, session records, terminalization, and recovery workflow.
- Dispatch queue redelivery and stale work are idempotent.
- One dispatch produces one terminal projection and does not post its Slack result twice.
- Authorization blocking and credential delegation remain bounded exactly as before.
- Existing plugin dispatch APIs and projections remain behavior-compatible.
- The dispatch lease, callback loop, incomplete index, and heartbeat recovery are deleted.
- Integration coverage proves success, blocked authorization, timeout continuation, duplicate wake/callback compatibility during cutover, delivery fencing, and worker recovery.
Non-goals
- Subagent bindings, invocation-result delivery, or model-facing delegation.
- Keeping a generic dispatch runner after migration.
Activity
[-]Migrate advisor onto the shared subagent runtime and add behavior coverage[/-][+]Migrate agent dispatch onto shared conversation execution[/+][-]Migrate agent dispatch onto shared conversation execution[/-][+]Migrate agent dispatch onto the conversation worker[/+]sentry-junior commentedon Aug 9, 2026
Reevaluation (post-#1059 / #1344)
Checked against main. The migration objective is done. Remaining work is cutover cleanup, not a second execution runtime.
Completion criteria
enqueueAgentDispatch: claim append →appendAndEnqueueInboundMessage→confirmDispatchMailboxAppendresolveAgentDispatchId+buildDispatchRoutingContextfrom the dispatch record / active turn; callback handler only enqueuescreateAgentDispatchConversationWorkerunder the conversation worker; turn checkpoints own resumepersistBlockedDispatchTurn/AuthorizationFlowDisabledErrorstore.ts/context.tsrunner.tsgone; callback route is enqueue-only; incomplete index is mailbox-append receipt only; heartbeat repairs appends then defers to conversation recoveryagent-dispatch-work+agent-dispatch-recoverycover routing, retries, delivery fencing, pre-cutover resume, mailbox-append repairLeftovers (not the migration)
These are
TODO(v0.116.0)cutover items, not an independent dispatch lifecycle:attempt,leaseExpiresAtMs,version, …)handlers/agent-dispatch.ts) still enqueue-only until aged outRecommendation
Close this issue as completed by #1059 (and reinforced by the #1344 execution rewrite). Track any remaining
TODO(v0.116.0)cleanup under #1267 or a small dedicated cleanup issue if still needed after the release window.sentry-junior commentedon Aug 9, 2026
Closing as completed.
Migration landed in #1059. Shared execution ownership was reinforced by #1344. Remaining
TODO(v0.116.0)items are cutover cleanup only (legacy record fields, incomplete-index key name, enqueue-only callback route), not a second dispatch execution runtime.See the reevaluation comment above for the criterion matrix.