Repository navigation
Description
Summary
When a provider adapter declines an active-run steer (ProviderAdapterSteerDeclinedError, wrapped as steerDeclined: true) for a delegatedCompletion wakeup while the parent run is still running, EffectWorker's command:steer-follow-up:... fallback (dispatchMode: "queue_after_active") is permanently rejected by Orchestrator.ts with "Delegated completion delivery is no longer dispatchable.". All retries then fail with OrchestratorCommandPreviouslyRejectedError, the outbox effect dies in status: "failed", and the parent thread never receives the delegated-task completion wakeup.
This was hit 3 times on T3 Code 0.1.11 with Antigravity continuation turns (whose steerDeclined trigger was later removed in #39767), and the underlying orchestrator bug is still present on main for any adapter that raises ProviderAdapterSteerDeclinedError (e.g. packages/provider-cursor/src/server/adapter.ts).
Root Cause (verified on main)
- A delegated child completes while the parent run is
runningon a provider advertisingsupportsActiveSteering. Orchestrator.tspromotes thedelegatedCompletionmessage.dispatchtosteer_active, persists the steering message on the active parent run, and enqueues aprovider-turn.steeroutbox effect.ProviderTurnControlService.steercatchesProviderAdapterSteerDeclinedErrorand wraps it withsteerDeclined: true.apps/server/src/orchestration-v2/EffectWorker.tscatcheserror.steerDeclined === trueand dispatchescommand:steer-follow-up:<effect.id>(message.dispatch,dispatchMode: { type: "queue_after_active" },steerFollowUpOfRunId: run.id, reusingmessage.idanddelegatedCompletion).- Bug 1 (
apps/server/src/orchestration-v2/Orchestrator.ts:7712-7719&NotificationMailbox.ts):(projection.messages.some((candidate) => candidate.id === command.messageId) && !isUndeliveredMailboxSteer(projection, command.messageId))
isUndeliveredMailboxSteeronly returnstrueifrun.statusis terminal (completed | failed | interrupted | cancelled | rolled_back) or the latest provider turn iscompleted. BecausesteerDeclinedhappens while the parent run and turn are stillrunning,isUndeliveredMailboxSteerreturnsfalse, andcommand:steer-follow-up:...is rejected with:
Delegated completion delivery is no longer dispatchable.
Subsequent outbox retries (attempts 2–5) replay the rejected receipt (OrchestratorCommandPreviouslyRejectedError), leaving the effectfailedand the wakeup permanently dropped. - Bug 2 (
apps/server/src/orchestration-v2/Orchestrator.ts:7787-7800):
Even ifcommand.steerFollowUpOfRunId !== undefinedpasses the check at line 7713, the active-steer promotion block at lines 7787–7800 does not guardcommand.steerFollowUpOfRunId === undefined, so asteer-follow-upfor adelegatedCompletionwithcompletionWake === "always"would immediately be re-promoted fromqueue_after_activeback tosteer_activeon the same running turn that just declined the steer.
Expected Behavior
- When
command.steerFollowUpOfRunId !== undefined(thesteerDeclinedfallback for a persisted steering message on a still-running run),Orchestrator.tsshould allow reusingcommand.messageIdfordelegatedCompletiondelivery (consistent with the guard at lines 7217–7228) instead of rejecting it viaisUndeliveredMailboxSteer. - A
steerFollowUpOfRunIddispatch must stayqueue_after_activeand not be re-promoted intosteer_activeat lines 7787–7800.
Observed Evidence (T3 Code 0.1.11, Windows x64)
orchestration_command_receipts: all 3command:steer-follow-up:effect:command:fixture:delegated-completion:dispatch:...commands recordedstatus = 'rejected'(Failed to dispatch orchestration command message.dispatch), while user-sentsteer-follow-upcommands on the same threads wereaccepted.orchestration_v2_effect_outbox:provider-turn.steerreachedstatus = 'failed',attempt_count = 5,cause: OrchestratorCommandPreviouslyRejectedError.- Parent run completed later with
delegatedCompletion.disposition = "open"and no queued follow-up run; the parent remained idle until manual intervention.
Related
- Antigravity wake/continuation turns decline all steers and bounce them back to the queue #39746 / PR fix(server): Antigravity wake runs accept steers again #39767 (removed
ProviderAdapterSteerDeclinedErrorfrom Antigravity wake runs, noting the error contract remains active inEffectWorkerand other adapters).
Activity