Files
kandev/apps
João Salavisa 96871ccdea fix(orchestrator): auto-resume dormant sessions after workflow queue (#1163)
* fix(orchestrator): auto-resume dormant sessions after workflow queue

When a workflow auto-start prompt is queued after a transient ACP stream
disconnect, no live agent exists to drain the queue via agent.ready.
The prompt sits orphaned until the user manually resumes the session.

Add scheduleAutoResumeForWorkflowQueue (called from queueAutoStartPrompt)
which fires tryEnsureExecution in the background when GetExecutionBySession
shows no live agent. This drives ResumeSession → agent.boot_ready →
handleAgentBootReady → drainQueuedMessageAfterTransition — the same path
a manual resume would trigger.

Guard with s.executor == nil so existing tests that don't wire the executor
are unaffected. Add isAgentRunningFn override to mockAgentManager for
mid-sequence state transitions, and add a regression test that exercises
the full chain end-to-end.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(orchestrator): clarify scheduleAutoResumeForWorkflowQueue boundary condition

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 11:42:05 +01:00
..
2026-05-31 21:35:11 +00:00