Skip to content

fix: let recurring automations start while a previous run still has work - #207148

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
openclaw/investigate-failure-and-open-fix-pr-ee7401
Nov 28, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
openclaw/investigate-failure-and-open-fix-pr-ee7401

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

A daily automation could finish one run, then fail before starting the next with Session controller identity requires a physical store scope. This happened when background work still held the earlier run’s session. The error looked like a store configuration problem even though both sessions were in the right store.

User Impact

The next occurrence can start a fresh session without interrupting or taking over the previous one. No configuration change or migration is needed. This does not re-enable disabled jobs or change who may run an automation.

Why This Change Was Made

The stable job key already serializes preparation. The new occurrence has its own session ID; also claiming the ID from the previous job row made two different controllers match. Drop only that old ID from the lookup. The physical store, job key, current session ID, and lifecycle revision still identify the new run.

Evidence

  • Forced the same chat-linked current job twice through an isolated Gateway, with the first run’s session still in use. On base 58e358887b85, the second cron.runs entry recorded the exact error above. With the fix, both occurrences reached the local fixture model endpoint, used different session IDs, and left the first session’s work active. No production monitor or external model account was used.
  • The committed regression also failed on base and passed with the fix (1.64 s). All 72 focused cron tests passed across five files, including session serialization, isolated runs, and creator-access revocation. The cron TypeScript shard, touched-file lint and formatting, and git diff --check passed.
  • Manually reviewed 58e358887b85..b544660623df. The published head aa11482bd3f8 has the same tree. Required CI passed (12 min 15 s for the workflow), and hosted ClawSweeper passed with no findings on that exact head.

Worked on by

Work sessions

Linked for team reference; these sessions aren’t public.

roboclaw-bot and others added 2 commits November 28, 2026 02:35
Do not claim the prior base row's session ID when starting the next occurrence. Detached work can still own that ID. The new run keeps its own incarnation and its stable job key.

Co-authored-by: VACInc <[email protected]>
Worked on by:
- @VACInc

Co-authored-by: VACInc <[email protected]>
OpenClaw-Publication: 1d38277d-6e61-4758-95ab-48689d4e97f2
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. labels Nov 28, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 28, 2026 02:37
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

Removes the previous occurrence’s session ID from the controller aliases claimed when preparing an automation run.

Example: The daily-monitor automation starts again while background work retains its earlier session.

  • Before: Preparation can fail with “Session controller identity requires a physical store scope.”
  • After: The new occurrence starts with its own session ID while the earlier session remains active and unchanged.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused, supported by a meaningful regression, and covered by successful exact-head CI, but required shipped-entry-point evidence is not inspectable.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A recurring automation can fail before inference because background work still retains the preceding occurrence’s session.
Reason: The maintainer-authored change restores distinct occurrence identity with a narrow repair and no new configuration or public contract.

Merge readiness

✅ Ready for maintainer review

This PR fixes a source-verifiable recurring-run failure that remains on main; no introduced correctness or security defect was found.

Reviewed head: aa11482bd3f8818f66849d6c5c27737ff15e1380

Before merge

None.

Findings

None.

Agent review details

How this fits together

Cron preparation resolves a job’s session, claims controller custody, and passes the admitted session to agent execution and persistence.

flowchart TD
  A[Recurring automation] --> B[Stable job admission]
  B --> C[Resolve occurrence session]
  C --> D[Claim controller custody]
  D --> E[Agent execution]
  E --> F[Session persistence]
Loading

Technical review

Best possible solution:

Keep the existing job admission owner and identify each occurrence using its current session rather than its predecessor’s ID.

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

The retained previous-session alias can select a second controller alongside the stable job controller, reaching the exact reported exception; no target code was executed during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete repair at the alias producer: it removes the conflicting predecessor identity while preserving current-incarnation custody and existing serialization.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3d1f9dfb3276.

Provenance checked

  • Cron preparation identity aliases changes intended behavior with a stated reason (300ef39: The original admission protected the captured session generation from maintenance during asynchronous preparation; the unified-controller refactor later retained its previous-session ID alias.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source 0, Tests +28. Total +28 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 28 0 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 29 1 +28

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 27, 2026, 9:52 PM ET / November 28, 2026, 02:52 UTC.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Nov 28, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit e758f2e into main Nov 28, 2026
215 of 216 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the openclaw/investigate-failure-and-open-fix-pr-ee7401 branch November 28, 2026 10:42
@vyctorbrzezowski

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…ork (openclaw#207148)

* fix: keep recurring jobs separate from their previous run

Do not claim the prior base row's session ID when starting the next occurrence. Detached work can still own that ID. The new run keeps its own incarnation and its stable job key.

Co-authored-by: VACInc <[email protected]>

* fix: let recurring automations start while a previous run still has work

Worked on by:
- @VACInc

Co-authored-by: VACInc <[email protected]>
OpenClaw-Publication: 1d38277d-6e61-4758-95ab-48689d4e97f2

---------

Co-authored-by: VACInc <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
…ork (#207148)

* fix: keep recurring jobs separate from their previous run

Do not claim the prior base row's session ID when starting the next occurrence. Detached work can still own that ID. The new run keeps its own incarnation and its stable job key.

Co-authored-by: VACInc <[email protected]>

* fix: let recurring automations start while a previous run still has work

Worked on by:
- @VACInc

Co-authored-by: VACInc <[email protected]>
OpenClaw-Publication: 1d38277d-6e61-4758-95ab-48689d4e97f2

---------

Co-authored-by: VACInc <[email protected]>

(cherry picked from commit e758f2e)

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…ork (#207148)

* fix: keep recurring jobs separate from their previous run

Do not claim the prior base row's session ID when starting the next occurrence. Detached work can still own that ID. The new run keeps its own incarnation and its stable job key.

Co-authored-by: VACInc <[email protected]>

* fix: let recurring automations start while a previous run still has work

Worked on by:
- @VACInc

Co-authored-by: VACInc <[email protected]>
OpenClaw-Publication: 1d38277d-6e61-4758-95ab-48689d4e97f2

---------

Co-authored-by: VACInc <[email protected]>
(cherry picked from commit e758f2e)

Companion audit: No later same-path, PR, or source-SHA follow-up found through pinned main.

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

impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS 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.

3 participants