openclaw - 💡(How to fix) Fix [Bug]: Scheduled non-codex cron runs get re-executed on the codex primary model, duplicating side effects

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…

After upgrading to 2026.5.18, scheduled crons whose payload.model is a non-codex model (e.g. minimax-cn/MiniMax-M2.7) execute their agentTurn twice. The configured-model run appears to complete normally — assistant stopReason=stop and side-effecting tools (Telegram message send, file writes) have already run — but its session.ended status is cleanup, not success. The run is then re-executed on the agent's codex agentRuntime model (openai/gpt-5.5, which is configured as the primary), which repeats the same work and ends status: success. Net effect: duplicate Telegram messages and duplicate file/state writes. Single-run before 2026.5.18.

Root Cause

After upgrading to 2026.5.18, scheduled crons whose payload.model is a non-codex model (e.g. minimax-cn/MiniMax-M2.7) execute their agentTurn twice. The configured-model run appears to complete normally — assistant stopReason=stop and side-effecting tools (Telegram message send, file writes) have already run — but its session.ended status is cleanup, not success. The run is then re-executed on the agent's codex agentRuntime model (openai/gpt-5.5, which is configured as the primary), which repeats the same work and ends status: success. Net effect: duplicate Telegram messages and duplicate file/state writes. Single-run before 2026.5.18.

Fix Action

Fix / Workaround

Possibly related: #84957 (cron payload.model resolution), #84886 (dispatch idempotency theme), #84912 (post-update cron regressions).

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading to 2026.5.18, scheduled crons whose payload.model is a non-codex model (e.g. minimax-cn/MiniMax-M2.7) execute their agentTurn twice. The configured-model run appears to complete normally — assistant stopReason=stop and side-effecting tools (Telegram message send, file writes) have already run — but its session.ended status is cleanup, not success. The run is then re-executed on the agent's codex agentRuntime model (openai/gpt-5.5, which is configured as the primary), which repeats the same work and ends status: success. Net effect: duplicate Telegram messages and duplicate file/state writes. Single-run before 2026.5.18.

Steps to reproduce

Core conditions: agent primary is a codex / gpt-5-family model; the cron's payload.model is a non-codex model.

  1. Create an isolated cron (payload.kind: agentTurn, payload.model: "minimax-cn/MiniMax-M2.7") whose prompt sends a Telegram message (reproduces with delivery mode: none in-prompt send, and with mode: announce).
  2. Let it fire on its schedule. (NOT via openclaw cron run — see note.)
  3. Inspect agents/<id>/sessions/<sid>.trajectory.jsonl and cron/runs/<jobId>.jsonl.

Expected behavior

The cron runs once on the configured payload.model; its normal completion is treated as success; side effects happen exactly once.

Actual behavior

Two session.started events share one runId / sessionKey:

  • attempt 1: provider=minimax-cn / MiniMax-M2.7 → does the work, sends Telegram, assistant stopReason=stop, then session.ended status=cleanup
  • attempt 2: provider=openai-codex / gpt-5.5 → repeats the work, sends Telegram again, session.ended status=success

Evidence (all scheduled non-codex crons I inspected since the upgrade show this):

  • Trajectory attempts=2: minimax→cleanup ‖ codex→success.
  • cron/runs/<jobId>.jsonl: the recorded provider flips from the configured model (pre-upgrade) to openai-codex/gpt-5.5 (post-upgrade), at the upgrade boundary.
  • Duplicate sends: with mode: none I see two [telegram] outbound send ok for one task (~80s apart); with mode: announce the chat receives two deliveries and the trajectory shows both attempts produced final output.

Important repro notes:

  • Reproduces on SCHEDULED triggers but NOT via openclaw cron run <id> (a debug force-run single-executes as minimax→success). The divergence appears to live in the scheduled-execution / completion-gate path, not the debug runner — so cron run cannot be used to verify a fix.
  • Setting agents.defaults.embeddedPi.executionContract: "default" does NOT fix scheduled runs. Per plugin-sdk/src/agents/execution-contract.d.ts, strict-agentic is documented as gpt-5-family-only and "inert off-provider", so it is unclear why a MiniMax-configured run is re-driven on the codex model at all.

OpenClaw version

2026.5.18 (regression vs 2026.5.12, which single-ran)

Operating system

macOS (Darwin 25.4)

Install method

npm global

Model

payload.model: minimax-cn/MiniMax-M2.7; agent primary: openai/gpt-5.5 (agentRuntime codex)

Provider / routing chain

My routing config: model.primary = "openai/gpt-5.5", model.fallbacks = ["minimax-cn/MiniMax-M2.7", "openai/gpt-5.5", "deepseek/deepseek-v4-flash", "moonshot/kimi-k2.6"]. (Listed for completeness; the trigger condition is primary=codex + payload non-codex, and appears independent of the fallback list.)

Possibly related: #84957 (cron payload.model resolution), #84886 (dispatch idempotency theme), #84912 (post-update cron regressions).

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…

FAQ

Expected behavior

The cron runs once on the configured payload.model; its normal completion is treated as success; side effects happen exactly once.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Scheduled non-codex cron runs get re-executed on the codex primary model, duplicating side effects