Skip to content

fix: align approval cleanup test with native timer cancellation - #174154

Merged
steipete merged 1 commit into
mainfrom
fix8/approval-native-timer-20261016
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix8/approval-native-timer-20261016

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the approval-manager CI test after the scheduler's native timer cancellation contract changed.

User Impact

No user-visible change. Approval expiry, handoff retention, and decision authority are unchanged.

Why This Change Was Made

#173597 deliberately removed the extra scheduler generation fence: “An injected clock that manually calls an already cancelled callback no longer gets a second generation fence; normal job cancellation and shutdown settlement remain.”

The handoff test still manually invoked that cancelled host callback. It now asserts cancellation of the original wake, the replacement's restarted deadline, retention at the original deadline, and cleanup at the replacement deadline. The one-live-host-timer guard remains unchanged.

Evidence

Current main reproduced hourly 38887900861's exact error: 44 passed, one failed with Gateway armed more than one host timer.

The repair passes 88 tests across the approval manager, approval expiry, and Gateway scheduler suites with --maxWorkers=1. Gateway-root test typecheck, scoped lint, formatting, whitespace, and fresh P2 autoreview pass. No production changes, retries, timeout increases, or disabled tests.

Three direct main pushes were rejected as non-fast-forward while unrelated changes landed. The patch is unchanged across those rebases; this PR provides a stable landing head.

The approval handoff test manually invoked a cancelled host callback after
arming its replacement. 53a452a (#173597) intentionally removed the
scheduler's second generation fence: "native timer cancellation is the
owner." This stale fixture consequently armed a second synthetic host timer.

Assert that handoff cancels the old 16000ms wake and that its final release
arms a live 17000ms wake. Keep the approval live at the original deadline
and verify cleanup at the replacement deadline. No production scheduling,
approval authority, timeout, retry, or skip behavior changes.

Proof: the original current-main file reproduced the hourly failure
(44 passed, 1 failed). The repair passes 88 tests across approval manager,
approval expiry, and Gateway scheduler suites with --maxWorkers=1.
Gateway-root test types, scoped lint, formatting, and whitespace pass.
Fresh isolated P2 autoreview: no actionable findings.
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review October 16, 2026 11:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T11:18:32.758638Z 09e8533 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 16, 2026
@steipete
steipete enabled auto-merge (squash) October 16, 2026 11:26
@steipete
steipete merged commit 1dbc6fb into main Oct 16, 2026
172 of 174 checks passed
@steipete
steipete deleted the fix8/approval-native-timer-20261016 branch October 16, 2026 11:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…4154)

The approval handoff test manually invoked a cancelled host callback after
arming its replacement. 02b90e5 (openclaw#173597) intentionally removed the
scheduler's second generation fence: "native timer cancellation is the
owner." This stale fixture consequently armed a second synthetic host timer.

Assert that handoff cancels the old 16000ms wake and that its final release
arms a live 17000ms wake. Keep the approval live at the original deadline
and verify cleanup at the replacement deadline. No production scheduling,
approval authority, timeout, retry, or skip behavior changes.

Proof: the original current-main file reproduced the hourly failure
(44 passed, 1 failed). The repair passes 88 tests across approval manager,
approval expiry, and Gateway scheduler suites with --maxWorkers=1.
Gateway-root test types, scoped lint, formatting, and whitespace pass.
Fresh isolated P2 autoreview: no actionable findings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant