Back to blog
EngineeringDate unavailable· min read

When the Resume Button Only Pretended to Work

I shipped a Resume button for paused missions two weeks ago. It flipped the database status from 'paused' to 'executing' and showed a green toast confirming the mission was running again. The UI looked perfect. The user flow felt right. And it didn't actually work.

The Problem: Status ≠ Execution

When you pause a mission mid-run, its orchestrator agent might still be queued or waiting for approval. Hitting Resume in that case should just flip the status back — the orchestrator will keep going on its own. That worked fine.

But if the orchestrator had already finished or failed, Resume would change the database row to 'executing' and do nothing else. The mission panel would show "Executing the plan" forever, with no agent behind it and no way to recover except manually dispatching a new orchestrator task from the raw task queue.

The bug surfaced as SCE-4070 after I paused a mission to tweak its autonomy level, then tried to resume it. Green toast. No action. The mission was stuck in a zombie state: 'executing' in the database but dead in the task queue.

The Fix: Resume Queues an Orchestrator

Resume now checks for a live orchestrator (queued, in_progress, or awaiting_approval) before doing anything. If one exists, it only flips the status and returns a new orchestrator_already_live flag so the UI can say "the orchestrator is still running" instead of "task queued."

If no orchestrator is running, Resume queues a new one, just like Approve does. The new orchestrator gets a different directive, though: instead of "plan and execute," it gets "a human paused this mission and has now resumed it."

That directive includes the mission's existing task IDs. The orchestrator calls get_task_result on finished children and wait_for_tasks on running ones. It doesn't re-plan from scratch. It doesn't double-spawn work that already has a task. It picks up where the mission stopped.

Two TDD Audit Rounds

Round 1 added the live-orchestrator check and fixed the toast message. The test suite proved that resuming with a live orchestrator skips dispatch, and resuming after insert-failure restores the original status instead of leaving the mission stuck.

Round 2 added the existing_task_ids parameter and the directive that tells the orchestrator how to use them. The test suite proved that a resumed orchestrator gets the IDs and that they come from the mission's task_ids array, not invented by the route handler.

What's Next

The Resume button now works the way I thought it did when I shipped it. The mission panel shows real execution state instead of fake status. And the orchestrator knows what its children are doing instead of spawning duplicates.

Next: the same pattern applies to Retry for failed missions. Right now Retry only works if the orchestrator task itself failed. If a child task failed and the orchestrator stopped, Retry does nothing. The fix is the same: check for a live orchestrator, queue one with existing_task_ids if needed, and hand it a directive that says "retry the failures."