openclaw - 💡(How to fix) Fix cron job timeoutSeconds: 600 ignored, jobs killed at ~67s [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60791Fetched 2026-04-08 02:47:11
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1locked ×1

Error Message

Setting timeoutSeconds: 600 (10 minutes) in a cron job payload has no effect — jobs are terminated at approximately 67 seconds with the error: Job is terminated at approximately 67 seconds with the timeout error above, regardless of the timeoutSeconds value set (tried 600, 900, etc.).

Root Cause

In cron.ts, the timeout logic is:

const configuredTimeoutMs = job.payload.kind === "agentTurn" && typeof job.payload.timeoutSeconds === "number"
  ? Math.floor(job.payload.timeoutSeconds * 1e3)
  : void 0;
if (configuredTimeoutMs === void 0)
  return job.payload.kind === "agentTurn" ? AGENT_TURN_SAFETY_TIMEOUT_MS : DEFAULT_JOB_TIMEOUT_MS;

Where AGENT_TURN_SAFETY_TIMEOUT_MS = 60 * 6e4 (60 minutes).

The configuredTimeoutMs appears not to be reaching the execution layer correctly. The execution appears to fall through to a ~67-second hard limit instead.

Code Example

Request timed out before a response was generated. Please try again, or increase agents.defaults.timeoutSeconds in your config.

---

{
  "cron": {
    "jobs": [{
      "name": "test-job",
      "schedule": "0 9 * * *",
      "payload": {
        "kind": "agentTurn",
        "timeoutSeconds": 600,
        "message": "Your daily report is ready."
      }
    }]
  }
}

---

const configuredTimeoutMs = job.payload.kind === "agentTurn" && typeof job.payload.timeoutSeconds === "number"
  ? Math.floor(job.payload.timeoutSeconds * 1e3)
  : void 0;
if (configuredTimeoutMs === void 0)
  return job.payload.kind === "agentTurn" ? AGENT_TURN_SAFETY_TIMEOUT_MS : DEFAULT_JOB_TIMEOUT_MS;
RAW_BUFFERClick to expand / collapse

Bug Description

Setting timeoutSeconds: 600 (10 minutes) in a cron job payload has no effect — jobs are terminated at approximately 67 seconds with the error:

Request timed out before a response was generated. Please try again, or increase agents.defaults.timeoutSeconds in your config.

Steps to Reproduce

  1. Create a cron job with timeoutSeconds: 600 in the payload
  2. Execute a job that takes longer than 67 seconds (e.g., one with multiple tool calls and model responses)
  3. Job is killed at ~67 seconds despite 10-minute timeout setting

Expected Behavior

Job should run for up to 600 seconds (10 minutes) before being terminated.

Actual Behavior

Job is terminated at approximately 67 seconds with the timeout error above, regardless of the timeoutSeconds value set (tried 600, 900, etc.).

Configuration

{
  "cron": {
    "jobs": [{
      "name": "test-job",
      "schedule": "0 9 * * *",
      "payload": {
        "kind": "agentTurn",
        "timeoutSeconds": 600,
        "message": "Your daily report is ready."
      }
    }]
  }
}

Analysis

In cron.ts, the timeout logic is:

const configuredTimeoutMs = job.payload.kind === "agentTurn" && typeof job.payload.timeoutSeconds === "number"
  ? Math.floor(job.payload.timeoutSeconds * 1e3)
  : void 0;
if (configuredTimeoutMs === void 0)
  return job.payload.kind === "agentTurn" ? AGENT_TURN_SAFETY_TIMEOUT_MS : DEFAULT_JOB_TIMEOUT_MS;

Where AGENT_TURN_SAFETY_TIMEOUT_MS = 60 * 6e4 (60 minutes).

The configuredTimeoutMs appears not to be reaching the execution layer correctly. The execution appears to fall through to a ~67-second hard limit instead.

Environment

  • OpenClaw version: (latest from npm)
  • Node.js: v24.14.1
  • OS: Linux 6.17.0
  • Gateway mode

Additional Context

Manual triggering of the same job with openclaw cron run <job-id> --timeout 300000 produces the same 67-second failure. The issue is consistent and reproducible.

extent analysis

TL;DR

The issue can be mitigated by adjusting the agents.defaults.timeoutSeconds configuration value to a higher setting, as the current timeout is being overridden by a hardcoded limit.

Guidance

  • Review the agents.defaults.timeoutSeconds configuration value and consider increasing it to match the desired timeout for cron jobs.
  • Verify that the configuredTimeoutMs value is being correctly calculated and applied in the cron.ts file.
  • Check for any other hardcoded timeout limits in the codebase that may be overriding the configured timeout value.
  • Test the cron job with a lower timeoutSeconds value to see if the issue persists, which can help determine if the problem is related to the specific timeout value or the overall timeout mechanism.

Example

No specific code example is provided, as the issue appears to be related to configuration and hardcoded values rather than a specific code snippet.

Notes

The root cause of the issue is not entirely clear, but it appears to be related to a hardcoded timeout limit overriding the configured timeoutSeconds value. Further investigation is needed to determine the exact cause and to identify a permanent fix.

Recommendation

Apply a workaround by increasing the agents.defaults.timeoutSeconds configuration value to a higher setting, such as 600 seconds, to match the desired timeout for cron jobs. This should allow the cron job to run for the desired amount of time without being terminated by the timeout error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING