Skip to content

[BUG] Force-stopping a workflow clears the agent journal/cache, breaking resume #72295

Description

@karanshukla

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Force-killing a workflow (TaskStop) clears the journal cache. When a workflow is stopped mid-run
and then resumed with resumeFromRunId, the completed agent results are not replayed from cache — the
workflow restarts from 0. The docs say completed agents return cached results on resume, but this
doesn't hold when the prior run was stopped rather than naturally completed/failed.

Repro for #1: Launch a workflow with 50+ agents, stop it mid-run with TaskStop, then call
Workflow({scriptPath, resumeFromRunId}) — progress resets to 0/N instead of continuing from where it
left off.

What Should Happen?

It should pick up on the cached data from the agents

Error Messages/Logs

Steps to Reproduce

  1. Launch a workflow with many parallel agents (we had ~59):
    Workflow({ script: "..." })
  2. Note the returned Run ID (e.g. wf_fa220529-84e) and Task ID (e.g. wu1wgavg2).
  3. Let it run partially — some agents complete, some fail or are still in-flight.
  4. Attempt to resume the still-running workflow:
    Workflow({ scriptPath: "...", resumeFromRunId: "wf_fa220529-84e" })
  5. → This correctly errors: "Workflow is still running. Stop it first with TaskStop."
  6. Stop the running workflow:
    TaskStop({ task_id: "wu1wgavg2" })
  7. Resume with the same run ID:
    Workflow({ scriptPath: "...", resumeFromRunId: "wf_fa220529-84e" })
  8. Expected: Completed agents replay from cache; only failed/incomplete agents re-run. Progress
    counter starts at e.g. 32/59.
  9. Actual: Workflow restarts from 0/59. All agents re-run from scratch, including ones that had
    already completed successfully.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.195

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions