Skip to content

[codex] Fallback when Windows gateway task exits early#76245

Merged
steipete merged 3 commits into
mainfrom
codex/fix-windows-schtasks-early-exit
Jul 5, 2026
Merged

[codex] Fallback when Windows gateway task exits early#76245
steipete merged 3 commits into
mainfrom
codex/fix-windows-schtasks-early-exit

Conversation

@steipete

@steipete steipete commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Windows scheduled-task fallback for the failure shape from Brad's workshop log: schtasks /Run is accepted, but the task quickly reports Last Run Result=0 / stopped and no gateway listener appears.

Previously the fallback only handled the "accepted but never starts" state (0x41303). This extends it to the early clean-exit/no-listener case by briefly polling for launch evidence, then launching the gateway script directly via the existing Startup-style detached fallback.

Validation

  • pnpm exec vitest run src/daemon/schtasks.startup-fallback.test.ts src/daemon/schtasks.test.ts
  • pnpm exec oxlint src/daemon/schtasks.ts src/daemon/schtasks.startup-fallback.test.ts

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels May 2, 2026
@clawsweeper

clawsweeper Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head a0826e6cde084949468b3f5ff1d218db3ace11b5, but the PR head is now 85c029b577c51bcc7c714f5e182b8716f4dc67a0. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (2 earlier review cycles)
  • reviewed 2026-07-01T14:22:36.809Z sha 8f4ef7b :: needs real behavior proof before merge. :: [P2] Handle clean-stopped transitions in the shared poll
  • reviewed 2026-07-05T12:54:38.562Z sha 08f8a80 :: needs real behavior proof before merge. :: [P2] Remove the manual changelog entry

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 17, 2026
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

The Windows failure mode remains plausible, but this stale patch should not land as-is.

Current shouldFallbackScheduledTaskLaunch() already owns a bounded launch-observation loop. Adding a separate two-second stopped-success loop duplicates its state machine and still leaves race/double-launch risk when the task exits cleanly while a process or listener is becoming observable.

Best fix: recreate on current main by folding clean-exit handling into the existing bounded polling path, retaining both process and listener launch evidence, and proving the accepted-run/clean-exit/late-listener cases on native Windows. With that proof, this is a good fix to land.

@steipete
steipete force-pushed the codex/fix-windows-schtasks-early-exit branch 2 times, most recently from de98ca4 to 7be3c98 Compare July 5, 2026 12:11
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed gateway Gateway runtime size: S labels Jul 5, 2026
@steipete
steipete force-pushed the codex/fix-windows-schtasks-early-exit branch from 7be3c98 to f758cb2 Compare July 5, 2026 12:19
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S and removed size: XS labels Jul 5, 2026
@steipete
steipete marked this pull request as ready for review July 5, 2026 12:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f758cb2e6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md

### Fixes

- **Windows Scheduled Task recovery:** keep clean early exits inside the existing bounded launch poll, falling back only when neither the task process nor Gateway listener becomes observable. (#76245)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the manual changelog entry

Root AGENTS.md says CHANGELOG.md is release-only and that release generation owns changelog edits for normal fixes. Adding this Unreleased entry here can leave stale or duplicated release notes when the generated changelog is produced; keep the release-note context in the PR body/squash/direct commit instead and leave CHANGELOG.md untouched.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/fix-windows-schtasks-early-exit branch 2 times, most recently from 9c35d5a to 08f8a80 Compare July 5, 2026 12:45
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 5, 2026
@steipete
steipete force-pushed the codex/fix-windows-schtasks-early-exit branch from 08f8a80 to a0826e6 Compare July 5, 2026 14:56
@steipete
steipete force-pushed the codex/fix-windows-schtasks-early-exit branch from a0826e6 to 85c029b Compare July 5, 2026 15:10
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 5, 2026
@steipete
steipete merged commit 33f7c17 into main Jul 5, 2026
106 of 112 checks passed
@steipete
steipete deleted the codex/fix-windows-schtasks-early-exit branch July 5, 2026 15:19

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Landed as 33f7c17. The rewrite consolidates clean Task Scheduler exits into the existing bounded 15-second observation loop: process/listener evidence wins, while direct fallback occurs only after timeout without evidence. Blacksmith proof passed 61 focused daemon tests; fresh autoreview was clean; exact-head CI run 28745161192 completed successfully, including native Windows checks-windows-node-test job 85234746136.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(windows): bound clean scheduler exits before fallback

* test(windows): cover scheduled task startup fallback

* test(windows): assert startup fallback is not running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant