Summary
Interactive / approval-gate workflows started from chat platforms (Slack, Telegram, Discord, GitHub) never resume after the user answers. Each answer starts a fresh workflow run at node 0 in a new worktree, so the workflow re-asks the same questions indefinitely. Web works correctly.
Root cause
dispatchOrchestratorWorkflow in packages/core/src/orchestrator/orchestrator-agent.ts only checks for a resumable run inside the platform.getPlatformType() === 'web' branch:
if (platform.getPlatformType() === 'web') {
const resumableRun = await workflowDb.findResumableRunByParentConversation(workflow.name, conversation.id);
if (resumableRun?.working_path) { /* hydrate + resume on working_path */ }
else if (workflow.interactive) { /* foreground */ }
else { /* dispatchBackgroundWorkflow */ }
} else {
// Slack/Telegram/Discord/GitHub: ALWAYS a fresh executeWorkflow, no resume lookup
await executeWorkflow(..., cwd, ..., { codebaseId, parentConversationId });
}
On chat, the natural-language approval path (and /workflow approve) records the approval, flips the paused run to failed, and calls dispatchOrchestratorWorkflow — which then takes the else branch and starts fresh. The prior run's completed nodes and loop_user_input (written onto the now-failed run's metadata) are never read by the new run, so the interactive loop repeats from the top.
How it regressed
The gap stayed latent because chat usage was mostly non-interactive workflows (which need no resume). It surfaces now that interactive approval-gate workflows (e.g. the archon-idea-to-wo style added around 0.3.12) are run from Telegram/Slack.
Reproduction
- Register a repo, run an interactive approval-gate / interactive-loop workflow from Telegram or Slack.
- When it asks its first question, reply with a normal (non-slash) message.
- Observed: a new
remote_agent_workflow_runs row is created and the same questions are asked again. Expected: the paused run resumes (failed → running) on its original worktree and advances.
Suggested fix
Lift findResumableRunByParentConversation + hydrateResumableRun out of the web-only gate so the resume lookup runs for every foreground dispatch (web + all chat), executing on the prior run's working_path. Keep dispatchBackgroundWorkflow web-only and non-interactive. (Resume on working_path, not a freshly resolved cwd.)
Affected: packages/core/src/orchestrator/orchestrator-agent.ts (dispatchOrchestratorWorkflow).
Environment: observed on 0.3.12, Docker deployment, Slack + Telegram adapters.
Summary
Interactive / approval-gate workflows started from chat platforms (Slack, Telegram, Discord, GitHub) never resume after the user answers. Each answer starts a fresh workflow run at node 0 in a new worktree, so the workflow re-asks the same questions indefinitely. Web works correctly.
Root cause
dispatchOrchestratorWorkflowinpackages/core/src/orchestrator/orchestrator-agent.tsonly checks for a resumable run inside theplatform.getPlatformType() === 'web'branch:On chat, the natural-language approval path (and
/workflow approve) records the approval, flips the paused run tofailed, and callsdispatchOrchestratorWorkflow— which then takes theelsebranch and starts fresh. The prior run's completed nodes andloop_user_input(written onto the now-failedrun's metadata) are never read by the new run, so the interactive loop repeats from the top.How it regressed
/workflow approveauto-resume via aresumeRunsignal returned by the command handler.resumeRunmechanism and routed approvals throughdispatchOrchestratorWorkflow, whose resume lookup is web-only — so chat lost auto-resume.resumeRunno longer exists in the codebase.The gap stayed latent because chat usage was mostly non-interactive workflows (which need no resume). It surfaces now that interactive approval-gate workflows (e.g. the
archon-idea-to-wostyle added around 0.3.12) are run from Telegram/Slack.Reproduction
remote_agent_workflow_runsrow is created and the same questions are asked again. Expected: the paused run resumes (failed → running) on its original worktree and advances.Suggested fix
Lift
findResumableRunByParentConversation+hydrateResumableRunout of the web-only gate so the resume lookup runs for every foreground dispatch (web + all chat), executing on the prior run'sworking_path. KeepdispatchBackgroundWorkflowweb-only and non-interactive. (Resume onworking_path, not a freshly resolvedcwd.)Affected:
packages/core/src/orchestrator/orchestrator-agent.ts(dispatchOrchestratorWorkflow).Environment: observed on 0.3.12, Docker deployment, Slack + Telegram adapters.