Skip to content

fix(cron): stale cron timeout aborts a later run in the same session - #163704

Merged
obviyus merged 2 commits into
openclaw:mainfrom
jayzhou2309:fix/cron-timeout-stale-run-abort
Oct 2, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
jayzhou2309:fix/cron-timeout-stale-run-abort

Conversation

@jayzhou2309

@jayzhou2309 jayzhou2309 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #163568

What Problem This Solves

Fixes: a cron job's timeout aborts an unrelated run when the cron turn already finished in a shared session such as agent:main:main, and another turn now owns that session.

User Impact

User impact: a stale cron timeout no longer cancels, force-clears, or tears down MCP tools for the operator's current chat turn. A cron run that is still active at its timeout is aborted and cleaned up exactly as before.

Why This Change Was Made

The cron execution record carried only the session id, so the timeout cleanup in src/gateway/server-cron.ts acted on whatever run held the session when the timer fired. The record now carries the cron invocation's run id, which every attempt, retry, and fallback of that turn registers its embedded handle under. Before it aborts, cleanup checks whether a different run (or an active reply run) now holds the session. If so it logs a warning and leaves the session alone. This is the run-identity fence the ClawSweeper review and the thread describe.

Out of scope: why the cron completion stayed pending after its run ended, and the later transcript writer-claim failure. Both are still unconfirmed. This does not overlap #143355 (timeout reason for background exec) or #137274 (retry settlement fence), and it does not touch agent-watchdog.ts.

Evidence

  • New timed-out agent run cleanup tests in src/gateway/server-cron.test.ts call the cron service's real cleanupTimedOutAgentRun with the real run registry and abortAndDrainEmbeddedAgentRun. Only retireSessionMcpRuntime is mocked.
    • Replacement case: on the test commit 0853957 it fails because the replacement's abort is called once (1 failed, 1 passed). On the fix 6bdc59b it passes, the replacement stays registered, and MCP is not retired.
    • Owner case: when the cron run still holds the session it is aborted and cleared and MCP is retired. It passes on both commits, so real timeouts keep their behavior.
  • src/cron/isolated-agent/run.invocation-context.test.ts asserts that onExecutionStarted reports the same run id the embedded runner receives. It fails on the test commit and passes on the fix.
  • pnpm test on the touched area: server-cron.test.ts 129/129, run.invocation-context, timer.timeout-watchdog, and agent-watchdog 36/36, and runs.test.ts plus runs.force-clear-terminal.test.ts 27/27.
  • oxlint and oxfmt --check are clean on the 6 changed files, and git diff --check is clean. node scripts/run-tsgo.mjs passes for tsconfig.core.json and the gateway-server and services-cron test configs.

Real behavior proof (live Gateway, before and after)

The agent ran the Gateway from source (node scripts/run-node.mjs gateway run) in a scratch HOME on the base commit ed754fa and then on the fix 6bdc59b. Node 26.8.2, logging.level: "debug", no real credentials. Two local stand-ins replace external services:

  • The model is a local OpenAI-compatible mock (models.providers.mock, api: "openai-completions"). It answers the cron turn at once and answers any turn containing SLOWTURN after 30 s.
  • The cron announce goes to an A2A peer (channels.a2a.peers.hermes) that accepts the request and never answers. This keeps the cron execution pending after its run has ended, the same state the issue shows. The A2A send gives up after about 30 s.

The script runs the same steps on both commits:

  1. openclaw cron add --name stale-timeout-probe --at 2h --session session:agent:main:main --message "cron ping" --timeout-seconds 15 --announce --channel a2a --to a2a:hermes --keep-after-run
  2. openclaw cron run <job>. The cron turn finishes in about 1 s, then its announce waits on the peer.
  3. About 2 s later, an operator turn on the same session: openclaw gateway call chat.send --params '{"sessionKey":"agent:main:main","message":"SLOWTURN operator question","idempotencyKey":"operator-<label>"}'
  4. Wait 45 s, then read the Gateway log, the mock log, and chat.history.

Before (ed754fa). The cron timeout aborts the operator turn, which started after the cron run ended (UTC, ids shortened):

19:00:59.656 embedded run done: runId=<cron-run> sessionId=<main> durationMs=1165 aborted=false
19:00:59.659 lane task done: lane=session:agent:main:main durationMs=1181 active=0 queued=0
19:01:01.175 embedded run start: runId=operator-before sessionId=<main> provider=mock model=mock-1 messageChannel=webchat
19:01:13.505 aborting run: sessionId=<main>
19:01:13.543 [model-fetch] error provider=mock ... name=AbortError code=OPENCLAW_DIRECT_ABORT message=agent run aborted
19:01:13.552 run cleanup: runId=operator-before sessionId=<main> aborted=true timedOut=false
19:01:13.603 cron: cleaned up timed-out agent run {"sessionKey":"agent:main:main","aborted":true,"drained":true,"forceCleared":false}
mock model: slow turn request ABORTED by client before the answer
chat.history tail: user: SLOWTURN operator question   (no assistant reply)

After (6bdc59b). Cleanup leaves the session alone and the operator turn finishes:

19:02:38.337 embedded run done: runId=<cron-run> sessionId=<main> durationMs=1412 aborted=false
19:02:40.377 embedded run start: runId=operator-after sessionId=<main> provider=mock model=mock-1 messageChannel=webchat
19:02:51.941 cron: timed-out agent run already left its session; kept the current run {"sessionKey":"agent:main:main"}
19:02:51.970 cron: job run returned error status {"error":"cron: job execution timed out (last phase: model-call-started)"}
19:03:10.542 embedded run done: runId=operator-after sessionId=<main> durationMs=30183 aborted=false
mock model: slow turn answered after 30000ms
chat.history tail: user: SLOWTURN operator question / assistant: chat turn finished normally

Each result held on two runs of the script per commit. On both commits the cron job still ends with cron: job execution timed out (last phase: model-call-started), the error the issue reports. Why the completion stays pending is out of scope, as stated above.

What this run did not cover:

  • MCP retirement. No MCP servers are configured, so retireSessionMcpRuntime has nothing to retire. The server-cron.test.ts owner case covers it.
  • The issue's own cause of the pending completion. A peer that never answers stands in for it.
  • A real model provider and Telegram.

Test cost

Measured locally. Per-test times come from full-file runs on the fix with --reporter=verbose:

  • The two new timed-out agent run cleanup tests take 54 ms and 92 ms.
  • The new run.invocation-context test takes 184 ms.
  • pnpm test src/gateway/server-cron.test.ts runs 129 tests in 38.0 s on the fix and 127 tests in 33.1 s on the base. A second run on the fix took 26.6 s, so the file's wall time varies more between runs than the new tests add.

Maintainer test-cost completion (exact head 6bdc59b268e2ccc25af381506ab40ac0b748b3a8)

Measured once in a secretless Linux arm64 Docker container (Node 26, pnpm 12.5.1), sequentially after installation/build; elapsed wall time includes the pnpm test wrapper and process startup:

Command Wall time Result
pnpm test src/gateway/server-cron.test.ts --maxWorkers=1 40.24 s Passed
pnpm test src/cron/isolated-agent/run.invocation-context.test.ts --maxWorkers=1 21.03 s Passed

Available exact-head CI cost from run 37046107141:

  • Gateway cron's small-14 job: 175 job wall seconds, including setup and other shards. Its agentic-control-plane-runtime-cron shard reports 29.47 Vitest seconds / 30.83 wrapper seconds across 12 files and 250 tests. The two new cleanup cases report 0.068 s and 0.089 s.
  • Invocation context's small-6 job: 168 job wall seconds, including setup and other shards. Its core-runtime-cron-parallel-isolated-agent shard reports 94.27 Vitest seconds / 96.03 wrapper seconds across 38 files and 394 tests. The new invocation identity case reports 0.197 s.

These are job/shard durations and individual test durations, not CI per-file wall times or estimates of marginal CI cost. CI does not report isolated wall time for either file. No CI jobs were rerun for this measurement.

No overlap with Pash/Sarah changes. Contributor commits and the contributor's before/after Gateway evidence above are retained unchanged.

AI disclosure

An AI agent (Claude Code) reproduced the wrong-run cancellation with the failing tests, wrote the fix, and ran the checks above: pnpm exec vitest run on the new tests on the test commit and on the fix, pnpm test on the touched test files, pnpm exec oxlint, pnpm exec oxfmt --check, git diff --check, and node scripts/run-tsgo.mjs. It also ran the live Gateway proof above against a local mock model and a mock A2A peer, on the base commit and on the fix.


🤖 Written and posted by an AI agent (Claude Code) on behalf of @jayzhou2309.

…ssion

The cron timeout cleanup aborts whatever run holds the session, so a
replacement turn in agent:main:main is aborted after the cron run ended.
These tests fail until cleanup is bound to the cron invocation run id.

Refs openclaw#163568
Cron timeout cleanup aborted, force-cleared, and retired MCP for whatever
run held the session. When the cron run had already ended in a shared
session, that hit an unrelated turn. Record the invocation run id on the
execution and skip cleanup when other work now holds the session.

Fixes openclaw#163568
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 5:58 PM ET / 21:58 UTC (Revision 3).

ClawSweeper review

What this changes

The PR binds scheduled agent timeout cleanup to the original run so it leaves a later conversation turn in the same session untouched.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main lacks the run-identity fence. The prior test-cost follow-up is complete, the runtime proof covers the reported cancellation boundary, and no blocking patch finding remains.

Priority: P1
Reviewed head: 6bdc59b268e2ccc25af381506ab40ac0b748b3a8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with convincing before/after production-path evidence and completed test-cost reporting.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The recorded before/after source-Gateway scenario exercises cron timeout cleanup through real command and chat entrypoints with local HTTP fault injection: the replacement request is aborted before the fix and completes afterward. Focused tests preserve original-owner cleanup; live MCP retirement is explicitly outside the trace. The added execution metadata is process-local and changes no stored-data contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The recorded before/after source-Gateway scenario exercises cron timeout cleanup through real command and chat entrypoints with local HTTP fault injection: the replacement request is aborted before the fix and completes afterward. Focused tests preserve original-owner cleanup; live MCP retirement is explicitly outside the trace. The added execution metadata is process-local and changes no stored-data contract.
Evidence reviewed 9 items Introduced patch: The pinned merge-base-to-head diff adds invocation identity propagation, a registry-backed replacement-run check, and focused regression coverage; it contains no dependency, workflow, configuration, or stored-schema changes.
Current main still needs the repair: Fetched main's cleanup callback aborts and drains by session identity without checking the originating invocation. Its active-run registry also lacks the introduced replacement-run predicate.
Identity survives progress updates: The cron invocation supplies the same run ID to execution-start notification and the embedded executor. The watchdog merges subsequent progress into its execution record, preserving that identity. Cleanup checks the live registry synchronously before entering the existing abort/drain path.
Findings None None.
Security None None.

How this fits together

The Gateway scheduler starts scheduled agent turns and tracks their execution progress. Timeout cleanup consults the active agent registry before aborting work and retiring session tools.

flowchart TD
  A[Scheduled job] --> B[Agent invocation]
  B --> C[Execution identity and progress]
  C --> D[Timeout cleanup]
  E[Current session run] --> D
  D --> F{Different run active?}
  F -->|Yes| G[Preserve current turn]
  F -->|No| H[Abort and drain scheduled work]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +23, Tests +84. Total +107 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 23 0 +23
Tests 2 87 3 +84
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 110 3 +107

Review metrics

Metric Value Why it matters
Production versus test growth production +23 net lines; tests +84 net lines Production growth carries invocation identity and consults the existing registry; tests protect identity propagation and both cleanup outcomes.
Test-cost disclosure one-worker wall times: 40.24 s and 21.03 s The prior reporting gap is resolved, with CI job and shard costs separately identified.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #163568
Summary: This PR is the candidate repair for wrong-run timeout cancellation; adjacent timeout work addresses distinct behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep timeout cleanup bound to its scheduled invocation while preserving normal cleanup when that invocation still owns the session.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main cleanup can target a replacement run by session ID, and the contributor supplies a before/after Gateway reproduction using delayed completion delivery. This review did not execute that scenario.

Is this the best way to solve the issue?

Yes: propagating the existing invocation identity and checking the live run registry is a narrow repair that preserves active-cron cleanup without changing scheduling or public configuration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0356bacb8c66.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The repair prevents a scheduled timeout from cancelling an unrelated active conversation turn and suppressing its reply.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The recorded before/after source-Gateway scenario exercises cron timeout cleanup through real command and chat entrypoints with local HTTP fault injection: the replacement request is aborted before the fix and completes afterward. Focused tests preserve original-owner cleanup; live MCP retirement is explicitly outside the trace. The added execution metadata is process-local and changes no stored-data contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. The recorded before/after source-Gateway scenario exercises cron timeout cleanup through real command and chat entrypoints with local HTTP fault injection: the replacement request is aborted before the fix and completes afterward. Focused tests preserve original-owner cleanup; live MCP retirement is explicitly outside the trace. The added execution metadata is process-local and changes no stored-data contract.

Evidence

What I checked:

  • Introduced patch: The pinned merge-base-to-head diff adds invocation identity propagation, a registry-backed replacement-run check, and focused regression coverage; it contains no dependency, workflow, configuration, or stored-schema changes. (src/gateway/server-cron.ts:721, 6bdc59b268e2)
  • Current main still needs the repair: Fetched main's cleanup callback aborts and drains by session identity without checking the originating invocation. Its active-run registry also lacks the introduced replacement-run predicate. (src/gateway/server-cron.ts:715, 0356bacb8c66)
  • Identity survives progress updates: The cron invocation supplies the same run ID to execution-start notification and the embedded executor. The watchdog merges subsequent progress into its execution record, preserving that identity. Cleanup checks the live registry synchronously before entering the existing abort/drain path. (src/cron/isolated-agent/run.ts:159, 6bdc59b268e2)
  • Production-boundary behavior proof: The captured PR body reports before/after runs through a real source Gateway, cron commands, chat.send, real provider HTTP requests to a local fault-injection server, and chat.history. On the base, the stale timeout aborts the replacement operator request; on the reviewed head, cleanup skips it and the assistant reply completes. Each scenario was repeated twice. MCP retirement is supplemental test coverage rather than a live MCP claim. (6bdc59b268e2)
  • Prior follow-up completed: The captured body provides one-worker wall times of 40.24 seconds and 21.03 seconds for the changed test files. GitHub confirms the cited workflow ran the reviewed head and both cited jobs succeeded, with durations matching 175 and 168 seconds. The body correctly distinguishes job/shard durations from unavailable per-file CI wall times. (6bdc59b268e2)
  • Focused regression contracts: The Gateway tests exercise the real cleanup callback and run registry for replacement and original-owner cases. The invocation test independently verifies that watchdog metadata names the executor's invocation. The supplied evidence records pre-fix failures and after-fix passes, with individual CI durations below 0.2 seconds. (src/gateway/server-cron.test.ts:1523, 6bdc59b268e2)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Avant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-02T18:22:25.789Z sha 6bdc59b :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-02T19:15:56.905Z sha 6bdc59b :: needs changes before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 2, 2026
@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

The remaining test-cost report is complete in the PR body: one-worker wall times for both changed test files, plus exact-head CI job/shard seconds and individual regression timings, clearly distinguished from per-file CI wall time. Source and tests remain at 6bdc59b268e2ccc25af381506ab40ac0b748b3a8; no CI reruns or pushes were made.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Exact-head CI has one failing test job: checks-node-changed-compact-large32-1, with recursive spawn production boundary > spawns for the named participant and transfers custody (visible=false) failing with Subagent browser cleanup lost its original owner. The aggregate ci-gate is consequently red. Cancelled jobs: 0.

A secretless Linux Docker replay of the entire src/agents/subagents/spawn/subagent-spawn.production-boundary.test.ts file, using pnpm test <file> --maxWorkers=1, passes 39/39 on both PR head 6bdc59b268e2ccc25af381506ab40ac0b748b3a8 (116.99 s Vitest) and merge-base ed754faa72449f6313310aed4517037daa50be15 (113.91 s). This is a local head/base comparison, not a claim that CI was rerun or that the original hosted failure disappeared.

The spawn fixture imports runs.ts, but this PR only adds an exported read-only predicate there; it changes no existing registry mutation or module initialization. Its new invocation is inside Gateway cron timeout cleanup, not subagent terminal browser-custody cleanup. The failure originates in subagent-registry-terminal-effects.ts:297 through lifecycle persistence. Both local variants pass and the changed timeout branch does not execute in that fixture. No same-case hosted main match was found in the two sampled main runs (37061184155 and 37054655798); those are not being cited as matching failures.

No CI reruns, source pushes, or base updates were performed to obtain green. The maintainer decides whether to use the inherited-failure exception.

@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Additional maintainer-observed proof, with the contributor head unchanged at 6bdc59b268e2ccc25af381506ab40ac0b748b3a8:

  • Built and ran isolated Gateways in secretless Docker, using the shipped openclaw.mjs --profile ... gateway run entrypoint, separate state/config/database paths, a local OpenAI-compatible HTTP stand-in, and a hanging A2A announcement. The cron invocation finished before an operator chat.send turn began in the same session.
  • Merge-base ed754faa72449f6313310aed4517037daa50be15: cron finished at 22:03:13 UTC; stale cleanup aborted the replacement at 22:03:27. The mock observed MODEL ABORTED true; no completed replacement assistant reply appeared.
  • Candidate: cron finished at 21:54:38 UTC; stale cleanup logged kept the current run at 21:54:52; the replacement finished at 21:55:09 with aborted=false. chat.history contained the assistant response chat turn finished normally.
  • Genuine-timeout control on candidate: a still-running cron turn was aborted at its deadline. Cleanup reported aborted:true, drained:true, forceCleared:false; the mock observed the cancellation. No real MCP server was configured; MCP retirement remains covered by the owner-boundary regression.
  • Regression: the candidate's timeout tests on merge-base production code give 1 failed / 1 passed: replacement cancellation fails at the assertion that its abort callback must not be called. The complete candidate Gateway test file passes 129/129, including that case and the original-owner control.
  • Live provider gate: one real gpt-5-mini request through a passive proxy returned HTTP 200. The exact-head Gateway's history contains the assistant reply LIVE_GATE_OK with stopReason:stop. Heartbeat and autonomous Workshop jobs were disabled; no Telegram claim is made.

All task containers, dependency/build volumes, and the temporary credential file were removed. No source changes, rebase, push, or CI rerun were needed for the test-cost completion. ClawSweeper's latest review is ready on the exact head; the separately documented existing CI failure remains for the maintainer's decision.

@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Maintainer override for the one red check, checks-node-changed-compact-large32-1 (https://github.com/openclaw/openclaw/actions/runs/37046107141/job/110968310252). The failing case is subagent-spawn.production-boundary visible=false, "Subagent browser cleanup lost its original owner". It exercises subagent terminal browser custody, not cron cleanup. This PR's only change to runs.ts is a read-only predicate that only the Gateway cron timeout cleanup calls. Running the whole file in Docker passes 39/39 on both the merge-base ed754faa72449 and this head (#163704 (comment)), so the failure doesn't come from this diff. The exact-head ClawSweeper review is ready, and the real-Gateway proof and live gate passed (#163704 (comment)).

@obviyus
obviyus merged commit 99f1f78 into openclaw:main Oct 2, 2026
167 of 171 checks passed
@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Landed as 99f1f78. Thanks @jayzhou2309!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…penclaw#163704)

Fixes openclaw#163568. A cron agentTurn's stale timeout cleanup no longer aborts a later turn that now owns the same shared session. The cron invocation records its runId, and timeout cleanup skips cancellation when another turn occupies the session. A genuine timeout still cleans up.
yozakura-ava pushed a commit to yozakura-ava/openclaw that referenced this pull request Oct 4, 2026
…penclaw#163704)

Fixes openclaw#163568. A cron agentTurn's stale timeout cleanup no longer aborts a later turn that now owns the same shared session. The cron invocation records its runId, and timeout cleanup skips cancellation when another turn occupies the session. A genuine timeout still cleans up.

(cherry picked from commit 99f1f78)
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cron agentTurn into a shared session times out after its run already finished, and the timeout aborts a different run in that session

2 participants