You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Delegated-task completions always jump ahead of queued messages, which can wait forever #34625
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
In a thread, delegate several tasks with delegate_task (async), and keep the thread busy so their results queue instead of steering into the running turn.
While the thread is busy, queue an ordinary message on it, from the composer or from another thread with t3_thread_send in queue mode.
Let the delegates keep finishing. Each time the thread's run ends, check which queued run starts next.
Expected behavior
Queued runs start in roughly the order they were requested. A completion that arrived after the queued message waits its turn.
Actual behavior
queuedRunsInDeliveryOrder (apps/server/src/orchestration-v2/QueuedRunOrder.ts) puts every queued delegated-task completion ahead of every other queued run, no matter when it arrived. A newer completion always starts first, so the ordinary message waits until no completion is queued at all. Under a steady stream of completions it never runs. We saw queued messages wait 39 to 65 minutes behind completions that arrived after them.
Impact
Major degradation or frequent failure
Version or commit
Observed on v0.1.3. The same code is on main @ 08930ca.
Environment
Desktop app, server-side orchestration. Any provider.
Workaround
Send urgent messages so they steer the running turn (auto mode), or promote a queued message to steer.
A fix is proposed in #34620. It keeps each kind's queue order and starts runs in request order.
Activity