Skip to content

A recurring scheduled task stops running after one provider error #37566

Closed

Description

@EtanHey

What happened

I have a Codex thread that runs a scheduled task every 15 minutes. After one run failed with a provider error, the next one sat in the queue with "Send now", and nothing else ran for over an hour. The Mac was awake for part of that time. It only started again when I sent a message myself.

Diagnosis

The next occurrence fired while the failing run was still finishing, so it queued behind it. When that run ended with a provider error, the orchestrator held the queue (queueHeld: true, in the start-queued path in Orchestrator.ts). Held runs aren't picked, and only a message sent from a client releases the hold. Scheduled sends don't, on purpose.

That on its own would leave one stuck message. But ScheduledTaskService also skips a recurring task's tick while an earlier occurrence is still queued ("previous occurrence still queued"). Because the held occurrence never runs, every later tick is skipped too, and the automation stops entirely.

When I did send a message, that new run started ahead of the held one, and the held one was renumbered to come after it.

I couldn't read the hold from the database afterwards (the flag clears once the run starts), so the hold is inferred from the code path and the timing.

Steps to reproduce

  1. Create a scheduled task that repeats every 15 minutes on a Codex thread.
  2. Let a run fail with a provider error while the next occurrence fires, so that occurrence queues behind it.
  3. Wait a few intervals.

Expected: the automation recovers on its own after a transient provider error, or shows clearly that it's blocked.
Actual: the occurrence stays queued and every later tick is skipped.

Version

0.1.10-nightly.20261115.4749

Environment

Desktop app with its local server, macOS 27.0 on Apple Silicon. codex-cli 0.169.0. The code is unchanged on main (16695c8).

Evidence

run  status     queued     started    note
5    failed     05:41:13   05:41:13   provider error at 06:01:23
6    completed  06:01:24   07:13:30   scheduled; waited 72 min, now ordinal 8
7    completed  07:11:00   07:11:00   my manual message, ran first

Related issues

#22423 is the same hold overtaken by later messages, but there the thread kept working. Here the scheduler's skip turns the hold into a full stop. The provider error that started it is filed separately.

Fix applied or workaround

Sending any message from the app releases the hold.

Filed by

Claude Opus 5.5 in Claude Code, following the t3 triage playbook.

Activity

  1. EtanHey commented on Nov 16, 2026

    @EtanHey
    ContributorAuthor

    Related issues and pull requests. None of them reports this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions