Skip to content

fix(cron): complete timeout test observation phase - #140076

Merged
steipete merged 1 commit into
mainfrom
codex/cron-timeout-observation-test
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cron-timeout-observation-test

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #139957, #138411

What Problem This Solves

Resolves a problem where the cron process-group timeout test hangs after process cleanup gains a separate exit-observation phase. This caused a 120-second CI failure on an otherwise unrelated PR.

Why This Change Was Made

Advance the fixture clock through both existing cleanup phases, matching the sibling execution test. The test still waits for a real descendant before firing the same command deadline, then checks the timeout result and descendant exit. Production code, timeout values, and existing assertions are unchanged.

User Impact

No runtime behavior change. The cron test now completes the existing cleanup lifecycle instead of waiting on a frozen observation timer.

Evidence

Secretless Linux proof used the same source base, Node 24.20.0 and pnpm 12.3.4 for both runs. The controlled probe keeps the real shell and descendant and holds only the owned process group's visibility through the first grace phase; actual termination signals are forwarded.

  • Baseline proof: the original timer order leaves one observation poll queued and the command unsettled. Only the intended clock-freeze assertion fails; cleanup confirms the descendant is gone. The force attempt returns ESRCH, so this is not claimed as signal-delivery proof.
  • Candidate proof: the same pending observation completes after the second phase, with the command settled and descendant gone. After removing all instrumentation, 79 cron, execution, termination and stdio tests pass; the existing Windows-only command-resolution case is skipped on Linux.
  • The required changed checks pass, including core test types, dead exports and lint. The final test hash matches the reviewed candidate, and production hashes are unchanged. Independent autoreview found no actionable P0–P2 findings.

Production delta: 0. Test delta: +2 lines.

Advance both existing cleanup phases before awaiting the real command result, matching the execution sibling. Preserve readiness, timeout and descendant-exit assertions without changing runtime code or deadlines.

Secretless hosted proof reproduces the original frozen observation poll and confirms candidate completion; 79 owner and sibling tests plus changed checks pass. Related: #139957, #138411.
@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 11:46
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 7:51 AM ET / 11:51 UTC.

ClawSweeper review

What this changes

Advance the cron timeout test’s simulated clock through exit observation so it can finish checking command timeout and descendant cleanup.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still needs this focused test repair. The added clock advance matches the cleanup lifecycle and preserves the existing assertions; no actionable defect was found.

Priority: P3
Reviewed head: 969bd12ef539cacd71b8ecf4f2ed2855705187b8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported test repair that preserves meaningful assertions and follows the existing sibling pattern.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored test repair. The captured body reports real-shell baseline/candidate settlement evidence for the cron runner’s observation timer; linked logs were inaccessible to this reviewer, and no independent execution is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored test repair. The captured body reports real-shell baseline/candidate settlement evidence for the cron runner’s observation timer; linked logs were inaccessible to this reviewer, and no independent execution is claimed.
Evidence reviewed 6 items Verified introduced change: The pinned merge-base comparison contains only the additional observation-phase clock advance and its comment. Command deadlines, readiness checks, timeout assertions, and descendant-exit assertion remain intact.
Production cleanup contract: After the graceful interval, forceAndObserve establishes a separate 300 ms deadline and polls through setTimeout. The process runner awaits terminationController.settle(), so a frozen observation timer can prevent the cron command promise from settling.
Existing sibling pattern: The inherited-pipe descendant timeout test already advances both cleanup intervals before awaiting its result, then restores real timers and checks descendant exit.
Findings None None.
Security None None.

How this fits together

Cron command jobs pass scheduled commands to OpenClaw’s process runner. When a command times out, the runner terminates its process group and observes cleanup before returning the result.

flowchart TD
  A[Scheduled command] --> B[Cron command runner]
  B --> C[Process runner]
  C --> D[Timeout and graceful termination]
  D --> E[Force termination and exit observation]
  E --> F[Timeout result]
  G[Test clock] --> D
  G --> E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Keep the existing cleanup lifecycle and let the test clock cover both bounded phases while retaining timeout and descendant-exit checks.

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

Yes, from source: when process-group observation continues past the first grace interval, current main awaits a promise whose remaining timer is frozen. The reported controlled probe exercises that condition; this review did not execute it.

Is this the best way to solve the issue?

Yes. Advancing the existing observation interval matches the sibling test without increasing deadlines, weakening assertions, or altering production behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 46c39bcfa5a7.

Labels

Label changes:

  • add P3: This is a bounded test-clock repair with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored test repair. The captured body reports real-shell baseline/candidate settlement evidence for the cron runner’s observation timer; linked logs were inaccessible to this reviewer, and no independent execution is claimed.

Label justifications:

  • P3: This is a bounded test-clock repair with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored test repair. The captured body reports real-shell baseline/candidate settlement evidence for the cron runner’s observation timer; linked logs were inaccessible to this reviewer, and no independent execution is claimed.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base comparison contains only the additional observation-phase clock advance and its comment. Command deadlines, readiness checks, timeout assertions, and descendant-exit assertion remain intact. (src/cron/command-runner.test.ts:183, 969bd12ef539)
  • Production cleanup contract: After the graceful interval, forceAndObserve establishes a separate 300 ms deadline and polls through setTimeout. The process runner awaits terminationController.settle(), so a frozen observation timer can prevent the cron command promise from settling. (src/process/exec-termination.ts:119, 969bd12ef539)
  • Existing sibling pattern: The inherited-pipe descendant timeout test already advances both cleanup intervals before awaiting its result, then restores real timers and checks descendant exit. (src/process/exec.test.ts:656, 969bd12ef539)
  • Current main still lacks the repair: Fetched main still awaits the command immediately after the first cleanup interval. Inspection of v2026.9.2 likewise found no second advance; that release comparison does not establish that the newer observation-phase defect existed in the release. (src/cron/command-runner.test.ts:182, 46c39bcfa5a7)
  • Related merged work and routing history: Current-main history lists Peter Steinberger on several process-cleanup changes, including cb22e07. Supplied GitHub metadata identifies fix(process): wait for subprocess cleanup on cancellation #139957 as merged and describes the additional observation phase. Exact parent-patch inspection and blame encountered unavailable objects and network resolution failures, so no source-line introduction attribution is asserted. (src/process/exec-termination.ts, cb22e0704114)
  • Captured proof and inspection limits: The supplied full PR body reports controlled Linux baseline/candidate observations: one pending observation poll and an unsettled command before, then settlement and descendant exit after advancing the second phase, followed by 79 passing focused tests. It explicitly disclaims force-signal delivery proof because the force attempt returned ESRCH. Both linked Actions pages could not be retrieved during review; these remain reported results, not independently inspected logs. No target code or tests were executed. (969bd12ef539)

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit 5e10ff9 into main Sep 6, 2026
168 checks passed
@steipete
steipete deleted the codex/cron-timeout-observation-test branch September 6, 2026 11:56
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit to NianJiuZst/openclaw that referenced this pull request Sep 6, 2026
Include the independently verified cron fixture repair from openclaw#140076 for fresh CI. Keep the reviewed file-fetch and media filename files byte-identical to the completed Unicode proof and preserve contributor ancestry.
vincentkoc pushed a commit to gaoanze888/openclaw that referenced this pull request Sep 6, 2026
* commit '3ed964c8ca6206d26ecc0b6567ccd1389d9948fc': (36 commits)
  refactor(plugins): unify install config snapshot preparation (openclaw#140081)
  fix: cloud provisioning stays failed after temporary storage recovers (openclaw#140021)
  fix(ci): preflight job outputs exceed 1 MiB on full-plan pull requests (openclaw#140018)
  refactor: consolidate command and provider helpers (openclaw#140072)
  fix(doctor): replace unavailable TUI cleanup advice (openclaw#140074)
  fix(plugins): avoid scoped pack failures and missing runtime entries (openclaw#140016)
  fix: clarify background command timeouts (openclaw#140022)
  fix(workboard): refresh board navigation while retaining drafts (openclaw#139952)
  fix: preserve newer chat drafts when rewind completes (openclaw#140066)
  feat(transcripts): browse and export saved meeting archives (openclaw#139875)
  fix(cron): complete timeout test observation phase (openclaw#140076)
  fix(macos): show the full automation count (openclaw#139692)
  fix: native worker turns fail to load WebSocket transport (openclaw#140071)
  fix(cli): complete quoted Bash option values (openclaw#140034)
  fix(chat): show command instructions while pending (openclaw#140041)
  refactor(cli): use canonical resume result schema (openclaw#140056)
  fix: restore package acceptance across install runtimes (openclaw#140062)
  refactor(auto-reply): keep model-selection fixtures in tests (openclaw#140069)
  fix(plugins): remove owned aliases before uninstalling files (openclaw#140065)
  fix: completed replies hang when context-engine cleanup stalls (openclaw#140023)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Advance both existing cleanup phases before awaiting the real command result, matching the execution sibling. Preserve readiness, timeout and descendant-exit assertions without changing runtime code or deadlines.

Secretless hosted proof reproduces the original frozen observation poll and confirms candidate completion; 79 owner and sibling tests plus changed checks pass. Related: openclaw#139957, openclaw#138411.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

1 participant