[Bug]: A Claude thread waiting on a ScheduleWakeup timer leaves Working and lands in the inbox #20249
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
packages/contracts or packages/shared
Steps to reproduce#
- Turn on the Working section beta.
- In a Claude thread, start a self-paced loop (
/loopwith no interval) or ask the agent to check something again later. The agent calls Claude Code'sScheduleWakeuptool, for example withdelaySeconds: 1200, and ends its turn. - Look at the sidebar while the agent waits for the wakeup.
Expected behavior#
The thread stays in Working until the wakeup fires and the agent finishes. The agent has not stopped. Claude Code will start a new turn in the same thread when the delay ends, and nothing needs the user before then.
Actual behavior#
The thread leaves Working as soon as the turn ends and goes to the inbox (the ready list) as if it were done. When the wakeup fires, the agent starts a new turn and the thread moves back.
Cause (from reading main @ cfafb4bb54)#
A pending wakeup is not recorded anywhere. ScheduleWakeup does not create an entry in pendingBackgroundTasks. The only kinds are command, subagent, monitor and background_task (packages/shared/src/orchestrationV2PendingBackgroundWork.ts). With nothing on the roster, the thread looks idle once its run completes. A code search for ScheduleWakeup and CronCreate finds no handling outside test fixtures.
This is a separate case from background commands. #15099 and discussion #15433 cover a thread that waits on a run_in_background command. That case is hard because a command can also be a dev server the agent walked away from. A wakeup has no such ambiguity: the agent always intends to come back.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.46-nightly.20261015.3176
Environment#
Linux x64 server, Claude provider (Claude Code harness, Opus 5.5)
Workaround#
None in the UI. A long /loop thread sits in the inbox between every iteration.
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
Reproduced on Linux x64, web dev app at 70e5e384da, Claude Code 2.1.303 / Opus 5.5, Working section enabled.
Asked Claude to check the time again using
ScheduleWakeupwithdelaySeconds: 120. The tool returnedscheduledFor: 1792622520000(22:42 UTC). The turn completed at 22:39:07 UTC and the thread moved from Working to the inbox. A self-paced/loopwith a 60-second wakeup reproduced the same transition.Runtime transcript · Loop recording. The dev server disconnected later, so this run does not verify the return when the wakeup fires.
Before turn completion:

After turn completion, wakeup still pending:

Reproduced on Linux web at 70e5e384da, with Claude Code 2.1.303 and Opus 5.5, using both a direct
ScheduleWakeuprequest and a self-paced/loop: the turn ended and the waiting thread moved from Working to the inbox.The proposed roster-based fix also changes when model, runtime/permission mode, and provider changes are refused. Both independent reviews require a maintainer decision on that behavior. The local draft also needs cancellation handling for
ScheduleWakeup({stop:true})returningscheduledFor: 0, plus banner wording cleanup. No PR opened; leaving this issue open for Julius.Reproduced on Linux x64 in the web dev app at 8acbefefc5, Claude Code 2.1.303 / Opus 5.5, Working section enabled.
A direct
ScheduleWakeup({delaySeconds:120})returnedscheduledFor:1792633020000(01:37 UTC). At 01:34:58 UTC the turn completed withpendingBackgroundTasks:[], and the thread left Working for the inbox. A self-paced/loopwith a 60-second native wakeup did the same at 01:35:48 UTC, before its 01:37 UTC wakeup.juliusmarminge closed this
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Confirmed on main: a pending
ScheduleWakeupisn't tracked, so the thread settles when the turn ends.backgroundWorkKindHoldsCompletiononly holds a thread forsubagent,monitorandbackground_taskentries inpendingBackgroundTasks. A code search findsScheduleWakeuponly in a test fixture, so nothing adds a roster entry for a scheduled wakeup. Once the run completes, the thread looks idle and leaves Working.This is separate from the background-command decision in #14910 (closed as intended in #18966; still open in #15099 and #17625). Commands were excluded because they're often long-lived processes the agent has walked away from. A wakeup is always meant to bring the agent back, so that reasoning doesn't apply here.
Keeping this open as a bug for the Working section beta.