Skip to content

[Bug]: Isolated cron job sessions fail to spawn after main session inactivity #64497

Description

@SalCat

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Isolated agentTurn cron jobs intermittently fail to spawn a session at all. The cron scheduler fires, waits 6–17 minutes, then reports "cron: job execution timed out" with no sessionId, no model, and no token usage — indicating the isolated worker never launched. The failure is correlated with main session inactivity: jobs succeed reliably when the main session is active, and fail intermittently after it goes idle.

Steps to reproduce

  1. Gateway is freshly started or main session is actively receiving messages → jobs complete successfully in 15–55 seconds ✅
  2. Main session goes idle for ~1 hour → next 2–5 isolated cron runs fail with Type B timeout ❌
  3. Main session receives a message → isolated cron run succeeds again ✅

This cycle repeats consistently. Post-update (2026.4.9), the job ran successfully 5 consecutive times while the main session was active, then failed twice once the session went idle.

Expected behavior

Isolated agentTurn cron jobs must not fail to spawn a session.

Actual behavior

Isolated agentTurn cron jobs intermittently fail to spawn a session at all

OpenClaw version

2026.4.9

Operating system

macOS 26.4 (arm64)

Install method

nom

Model

anthropic/claude-sonnet-4.6

Provider / routing chain

local loopback

Additional provider/model setup details

No response

Logs, screenshots, and evidence

**Affected job**  
  
- Job ID: `035c3507-2f85-4d43-9a68-20ec3a3599f1`  
- `sessionTarget: "isolated"`, `payload.kind: "agentTurn"`, `lightContext: true`  
- Schedule: every 55 minutes  

  
Two distinct failure modes appear in the run history:  
  
**Type A — Anthropic API timeout** (has `sessionId`, model info present):  
  
error: "Request timed out before a response was generated"  
durationMs: ~63000–176000  
  
The session launched but Anthropic timed out. This was partially addressed by adding `lightContext: true`.  
  
**Type B — Session never spawns** (no `sessionId`, no model):  
  
error: "cron: job execution timed out"  
durationMs: 267000–1077000 (~4–18 minutes)  
  
The gateway never launched the isolated session. No Anthropic call was made. This is the dominant failure mode and is **not fixed** by `lightContext: true` or updating to 2026.4.9. 

  
**Sample run history (chronological, today)**  
  
| Time (EDT) | Status | Duration | sessionId? |  
|---|---|---|---|  
| 07:54 | ✅ ok | 14s | yes |  
| 08:23 | ❌ timeout | 794s | no |  
| 09:18 | ❌ timeout | 963s | no |  
| 10:11 | ❌ timeout | 267s | no |  
| 10:57 | ❌ timeout | 1018s | no |  
| 12:29 | ✅ ok | 15s | yes |  
| 14:11 | ✅ ok | 54s | yes |  
| 15:06 | ✅ ok | 21s | yes |  
| 16:01 | ✅ ok | 32s | yes |  
| 17:00 | ✅ ok | 27s | yes |  
| 17:57 | ❌ timeout | 991s | no |  
| 18:52 | ❌ timeout | 404s | no |  
  
Active session periods align exactly with successful runs. Idle periods align with Type B failures.

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclose:duplicateClosed as duplicatededupe:childDuplicate issue/PR child in dedupe clusterregressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions