Skip to content

Chat (Slack/Telegram) approval & interactive-loop workflows never resume — re-ask the same questions forever #1741

@133Felix

Description

@133Felix

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

  1. Register a repo, run an interactive approval-gate / interactive-loop workflow from Telegram or Slack.
  2. When it asks its first question, reply with a normal (non-slash) message.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions