Waiting detector (part 4)
Part 4 of the Waiting detector page: the ScheduleWakeup check-in mode an agent can opt into, then the rest of the technical reference — the three rejection guards, the live-corpus validation, every setting and kill switch, the subagent defense-in-depth gate and the idempotency and race protections.
On this page
What it is
This is part 4 of the Waiting detector page. It covers the timer side of the same wait decision — the ScheduleWakeup tool's opt-in check-in mode — and then the rest of the reference material for anyone with the code open: the three rejection guards that qualify a pattern match, the corpus validation behind the patterns, every setting and kill switch, the subagent defense-in-depth gate, and the guards against duplicate or racing timers.
Where to find it
The same surface as the parent page: the session chat, where the orange ⏱ Auto-waited pill sits above the agent reply that fired and the Keep waiting and Check in buttons sit above the message box; the Needs You inbox row and its right-click menu; the controls under Settings → Sessions; and the audit log at Settings → Diagnostics → Waiting Detector activity.
How it behaves
ScheduleWakeup check-in mode (agent opt-in, sister feature)
A sibling of Gate 6, on the tool side of the wait classifier. The ScheduleWakeup tool (the explicit deferral path Gate 6 falls back from) accepts an opt-in checkIn: boolean field in its input. When the agent passes checkIn: true, the timer-fire reframes the re-injection so the agent treats it as a self-scheduled check-in — should I keep waiting? — rather than a fresh user-style instruction. The session stays running either way; the difference is in how the agent perceives the re-injection and in how the banner reads to you.
| Mode | Tool call | Banner | Re-injection at timer fire | Operator-row metadata.kind |
|---|---|---|---|---|
| Default (today's behavior) | ScheduleWakeup({delaySeconds, prompt}) or ScheduleWakeup({…, checkIn:false}) |
"Agent scheduled wake-up in <span> — staying running until then." |
Agent's prompt injected verbatim as an operator message |
'schedule-wakeup' |
| Check-in | ScheduleWakeup({delaySeconds, prompt, checkIn:true}) |
"Agent scheduled check-in in <span> — staying running, will not surface to inbox." |
Agent's prompt wrapped with the contract-locked [Check-in] framing prefix (decide: keep waiting, proceed, or end the turn to surface) |
'schedule-check-in' |
Live units (both modes). The banner shows a human span, not raw seconds, and counts down live while the agent sleeps: the remaining time is recomputed about every 30 seconds. The span runs minutes under an hour ("in 20 minutes", "in 19 minutes", … down to "less than a minute"), then whole hours ("in 20 hours"), then days — a twenty-hour wake never reads "in 1220 minutes". Once the wake time passes the banner freezes to the original scheduled duration — it deliberately does NOT flip to "any moment now", so a banner that was superseded by the agent re-scheduling can't overclaim an imminent wake. Mechanics: the wording is produced by the shared formatScheduledWakeBanner helper (scheduled-wake-format.ts), whose wakeSpanUnits is also the rung the settled ⏱ tag renders (translated there, English in the banner, whose sentence frame is English); the backend stamps the absolute wake time (scheduledWakeAt) and mode into the message metadata; the renderer's ScheduledWakeBanner reads them and re-renders on a shared 30 s tick. Locked by contract invariant I10.
Scope. Check-in mode is exclusive to ScheduleWakeup — it is not auto-applied to Bash-background deferrals or Gate 6 prose-pattern waits. Those paths keep their pre-feature behavior. The checkIn field only lives on the schedule_wakeup arm of Session.deferredWork; no other deferred-work kind even has the field. (Contract invariant I7.)
When to use it (agent-side guidance). The default mode is right when the agent has scheduled work that should return to the user when the delay elapses (the prompt at fire-time is essentially the next user-style instruction). Check-in mode is right when the agent wants to re-evaluate an external condition silently — poll a queue, watch a CI run, or pace a /loop iteration — without surfacing to the inbox. Calling ScheduleWakeup again with checkIn: true from the check-in turn extends the wait by another delay window.
What the user sees. Two things: (1) the inline banner uses different wording so check-ins are visually distinct from wake-ups in the conversation log, and (2) the re-injection appears as a normal operator message whose first line starts with [Check-in] — that's the framing prefix the agent reads on re-entry. The session never flips to Needs You during a check-in cycle; only an end-of-turn that doesn't re-arm a check-in will surface.
Kill switch. There isn't one. The flag is opt-in per ScheduleWakeup call; the agent simply not setting checkIn: true is the off state. If the framing prefix ever needs to change, it's the single constant CHECK_IN_FRAMING_PREFIX in ndjson-handler-constants.ts, contract-locked by I7.
Related
The overview, the coverage of non-Claude engines and the everyday controls are on the parent page; part 2 covers the cap, the agent-stated ETA window, the Keep waiting and Check in buttons, the automatic check-ins, the inbox right-click menu and the confirmation probe; part 3 covers what the detector deliberately never does, the optional AI second opinion, and the first half of the technical reference.
Last verified 2026-10-05