Skip to content

fix: preserve local wait budgets across wall-clock changes - #199951

Merged
obviyus merged 2 commits into
mainfrom
fix/monotonic-local-deadlines
Nov 16, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/monotonic-local-deadlines

Conversation

@obviyus

@obviyus obviyus commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Local waits can end early or overrun their allowance when the system wall clock changes, affecting accepted exec followups, runtime auth, process exit, Scheduled Task settlement, and managed update handoffs.

User Impact

These five waits retain their elapsed-time budgets across wall-clock corrections. Existing messages, persisted timestamps, RPC epochs, and helper-owned shutdown settlement are unchanged.

Why This Change Was Made

Reuse the existing monotonic-time owner for local budgets and explicitly select its clock in the handoff scheduler. Keep integer agent.wait timeouts with Math.ceil. Runtime auth converts only its internally created startup budget: upstream command-queue epoch deadlines remain epochs and can still be affected by clock corrections. The handoff closed command still joins its helper without a shorter parent timeout.

Evidence

  • Full-tier built CLI/Gateway proof compares main 7997daf with exact head a3e85ac, twice per stepped case plus unstepped controls. Real owner-only /export-trajectory approvals reach the accepted followup: main observes for about 60 seconds after a clock jump; the candidate preserves six minutes. Real agent --local auth-profile failover shows main expiring early or accepting a late auth exchange, while the candidate retains its actual seeded budget.
  • Only the tested process's Date.now changes by preload; performance.now, timers, budgets, and upstream deadlines are not replaced. Deterministic loopback providers exercise the shipped runtime. Windows schtasks proof remains unit-level only; managed update handoff remains source-level with real child pipes, not an installed update.
  • 75 initial consumer checks passed. After aligning the Scheduled Task fixture, 55 daemon checks passed, including all three unavailable-settlement cases and 37 additional settlement cases. Production type diagnostics and changed-file formatting/lint were clean.
  • Full built-entry-point receipts and proof bounds; original five-owner paired measurements.
  • Native probe work and mocked sleep now advance the same existing settlement fixture clock; unavailable-settlement, exact-budget, and no-false-restart assertions remain.
  • Full proof at a3e85ac: ocx build --dts passed, followed by packed tarball integrity validation and isolated packed CLI version/help smoke.
  • No new clock framework or test-only production exports. Test changes consolidate reconnect clock-step cases and remove incidental duplicate logging-field assertions. Production: +40/-24 lines (+16); tests: +15/-19 (-4).
  • Maintainer override: inherited CI lint receipt on the exact CI merge main parent. The PR does not alter the failing tool-search file or lint rule.

Prior Reports

Supersedes the closed per-site PRs #181942, #195457, #187439, #190976, #199640, and #199665. Thanks to @mikasa0818, @shuisadev, and @SunnyShu0925 for those prior reports.

Two-way door: reverting restores the old local wait calculations; no stored data, configuration, or public protocol changes. Blast radius is limited to these five wait owners.

@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Nov 16, 2026
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Timing proof against main 7997daf. Both stepped main runs and both stepped candidate runs completed for every site, with unstepped controls. All runs used ocx on macOS with isolated HOME/state; only the tested process's Date.now changed after its deadline was seeded. performance.now and the system clock were untouched.

Wait Real budget Main after wall-clock step Candidate after same step
Accepted exec followup observation 360,000ms 1,004 / 1,003ms 360,003 / 360,003ms
Process graceful exit before escalation 300ms 107 / 102ms 312 / 326ms
Runtime auth cumulative local budget 400ms backward: 1,202–1,216ms; forward: about 41ms 408–428ms in either direction
Scheduled Task settlement 330,000ms about 0.45ms 330,001 / 330,002ms
Managed handoff readiness/response 200ms backward: 1,001–1,030ms about 202ms

Unstepped behavior matched. Followup observation kept the accepted agent as sole delivery owner and every observed agent.wait timeout was a positive integer. Auth unlimited budgets and upstream epoch deadlines retained their behavior; upstream epoch deadlines intentionally remain outside this local-budget repair. Handoff closed commands still joined their helper beyond the ordinary response allowance. Every child process was closed.

Proof tiers: source for auth and handoff (real source imports and real child pipes); vitest-source for followup and daemon boundaries. The Windows cases are unit-level native-boundary fixtures on macOS, not live Windows proof. Followup uses the production send entry point with a Gateway transport fixture. Auth operations are delayed promises receiving the real abort signal. These timings do not claim full OAuth, Gateway/model, installed updater, or Task Scheduler E2E coverage.

Candidate head: 6a095fb. Host-isolation gate passed: only the five TypeScript wait owners and the followup consumer test changed; no package, install, scripts, hooks, or src/security paths changed.

Full tier also passed at this head: dist plus declarations, canonical packed-tarball integrity validation, and isolated packed CLI version/help smoke (the packed entry point reported 6a095fb). All 75 focused consumer tests, changed-file formatting/lint, and targeted type diagnostics passed.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: a3e85ac9ba27ed5b6e7e0050c9214dacbda1b25d
  • Maintainer: @obviyus
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/bash-tools.exec-approval-followup.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/runtime-auth-refresh.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves five process-local wait budgets to the existing monotonic clock while preserving exchanged epoch deadlines.

Example: The wall clock advances ten minutes while an accepted exec continuation remains active.

  • Before: Followup observation ends after approximately 60 seconds.
  • After: Followup observation retains its six-minute allowance and the accepted agent remains the delivery owner.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused, correct repair with strong new shipped-entry-point evidence, a resolved fixture finding, and documented limits on native-platform coverage; no persisted format or migration changes.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the contributor proof gate; its new exact-head shipped CLI/Gateway receipts strongly exercise auth failover and accepted followup observation, with narrower Windows and handoff coverage explicitly disclosed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: System clock corrections can prematurely end active observation or authentication and extend service-control waits.
Reason: The maintainer-authored scope restores existing elapsed-time allowances through established owners without new configuration, public APIs, or stored formats.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs concrete local-budget failures still present on main. The pinned diff has no actionable correctness or security findings.

Priority: P2
Reviewed head: a3e85ac9ba27ed5b6e7e0050c9214dacbda1b25d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Native Windows Scheduled Task clock-step behavior and an installed-update run are not demonstrated; their supplied evidence remains unit-level and source-level real-child-pipe coverage respectively.
Agent review details

How this fits together

Agent execution, Windows service control, and managed-update orchestration consume timeout allowances and asynchronous outcomes; their existing owners decide completion, escalation, or timeout.

flowchart TD
  A[Agent or service operation] --> B[Existing wait owner]
  B --> C[Monotonic local budget]
  B --> D[Gateway provider or child process]
  C --> E[Completion or timeout]
  D --> E
  F[Upstream epoch deadline] --> B
Loading

Technical review

Best possible solution:

Use the existing monotonic owner for these local budgets while retaining epoch-valued external deadlines and existing lifecycle settlement ownership.

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

Current-main arithmetic exposes the clock-step failure directly, and submitted paired built-entry-point receipts demonstrate it for auth and exec followups; this read-only review executed no target code.

Is this the best way to solve the issue?

This is the smallest complete repair for the five selected owners: replace local clock arithmetic, retain existing policy and external epoch contracts, and align affected fixtures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5e69e0c1eb66.

Provenance checked

  • Accepted exec followup observation keeps the original intent (602b575: Bound observation while keeping the accepted agent as sole delivery owner through ambiguous waits and reconnects.)
  • Runtime auth startup budget keeps the original intent (7bd53ff: Share one startup authentication allowance across lookup and exchange, then honor the execution owner's published deadline and cancellation.)
  • Scheduled Task settlement keeps the original intent (5232aba: Wait for the captured task run to settle, preserve replacements, and distinguish unavailable inspection from a completed restart.)
  • Process exit wait keeps the original intent (unknown: The scheduled-task split carried forward bounded exit observation before escalation; git log -S over the split and former schtasks module encountered an unavailable historical blob, so the earlier introduction remains unknown.)
  • Managed handoff response keeps the original intent (9b3f350: Bound readiness and ordinary responses while allowing the canonical helper to own shutdown settlement after the closed command.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +16, Tests -4. Total +12 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 40 24 +16
Tests 3 15 19 -4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 55 43 +12

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.

Review metrics

Metric Value Why it matters
Production versus test delta Production +40/-24; tests +15/-19 The modest production growth selects the existing clock and preserves rounding and clock-domain boundaries; consumer fixtures shrink overall.

Root-cause cluster

Relationship: canonical
Canonical: #199951
Summary: This consolidated repair owns the selected remaining local-budget sites; the earlier merged foundation deliberately excluded these lifecycle areas.

Members:

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Clock corrections can shorten or extend active waits, with concrete reproduced effects but limited exposure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-16T04:35:46.580Z sha 6a095fb :: needs changes before merge. :: [P2] Align the settlement failure fixtures with the monotonic clock
  • reviewed 2026-11-16T04:56:18.104Z sha a3e85ac :: needs maintainer review before merge. :: none

Reviewed November 16, 2026, 1:10 AM ET / 06:10 UTC (Revision 3).

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the settlement fixture clock finding at a3e85ac.

The failure cases now advance the existing shared timeState for simulated PowerShell work. That same state already drives Date.now, performance.now, and mocked sleep. The private wall-clock override is removed; unavailable-settlement, exact 330,000ms budget, and no-false-restart assertions are retained.

Observed validation through ocx on this head:

  • 55 daemon cases passed in schtasks.settlement.test.ts and schtasks-state-probe.test.ts, including all three reported failure variants.
  • Changed-file formatting and lint passed with no warnings/errors.
  • Full dist/declaration build, packed tarball integrity validation, and isolated packed CLI version/help smoke passed; the packed entry point reported a3e85ac.

This followup changes only consumer test fixtures. All five production owners are unchanged from the paired timing measurements in #199951 (comment). Whole-PR deltas remain production +16 lines and tests -4 lines; no src/security paths changed.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 16, 2026
@obviyus

obviyus commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Maintainer override: the only blocking CI validation failure is inherited from this run's main parent, not introduced by this PR.

Both CI and the main-parent replay report:

src/agents/tool-search-prepared-catalog.ts:118:48: error:
Use structuredClone(…) to create a deep clone. (unicorn(prefer-structured-clone))

The main-parent replay exited 1 with 0 warnings and 1 error. This PR does not change that file or the lint rule/configuration. Its changed-file lint passed; no unrelated source repair or CI rerun was performed. The failed ci-gate is downstream of this inherited lint failure: https://github.com/openclaw/openclaw/actions/runs/43806472740/job/133108508938.

The additional failed ci-gate status links to https://github.com/openclaw/openclaw/actions/runs/43809770205. This is the Security Review workflow_run publisher: its resolve and review jobs succeeded, and its review job explicitly targets PR 199951, head a3e85ac, CI run 43806472740 attempt 1. It reflects the same inherited CI failure, not another failed validation job. Current-head cancelled jobs: 0.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Built-entry-point timing proof for main 7997daf and candidate a3e85ac. Both sides used full dist/declaration artifacts. Runs went through ocx with isolated HOME/state/config and task-owned loopback fixtures. No production code changed. Only the tested process's Date.now was stepped by a preload; performance.now, timers, timeout budgets, and upstream deadline callbacks were not replaced.

Runtime auth: shipped agent --local

Command shape: ocx run -- env <isolated paths> node --import <clock preload> <artifact>/dist/entry.js --profile <task profile> agent --local --agent main --session-id <task session> --message 'Return AUTH-PROOF-OK.' --thinking off --timeout 10 --json.

A task-owned provider performs real loopback HTTP credential exchanges: profile A rejects with HTTP 401 after 350ms; profile B takes 12,000ms. The clock steps about 158–168ms after the actual runtime-auth seed, while the first exchange is pending. The CLI legitimately spends some of its ten-second command budget before constructing runtime auth, so the measured seeded budgets—not an assumed ten seconds—are listed below.

Clock step Main seeded budget / measured auth window Candidate seeded budget / measured auth window
+30,000ms, repetition 1 9,250ms / 367ms 9,287ms / 9,282ms
+30,000ms, repetition 2 9,353ms / 370ms 9,183ms / 9,176ms
-30,000ms, repetition 1 9,341ms / 12,379ms 9,303ms / 9,296ms
-30,000ms, repetition 2 9,159ms / 12,376ms 9,162ms / 9,157ms
No step, same slow exchanges 9,202ms / 9,197ms 9,184ms / 9,178ms

On main, forward steps cause the shipped credential-resolution timeout before profile B enters. Backward steps allow profile B's auth exchange to finish over three seconds beyond the real allowance. The candidate aborts at the real allowance in both directions. Important bound: main's late backward exchange does not produce a successful turn; an independent state-ownership renewal fence subsequently rejects it. No late inference success is claimed.

An additional unstepped fast control uses two 350ms exchanges: both artifacts exit 0, send one real streamed /v1/chat/completions request with the exchanged runtime credential, and return AUTH-PROOF-OK with agentHarnessId=openclaw.

Read-only inspector coverage records one real createEmbeddedRunAuthController and one createRuntimeAuthDeadline per process, with shared calculations across profile failover. The candidate's upstream epoch subtraction branch has execution count zero: this exercises the requested internal fallback, without modifying getDeadline or upstream epoch semantics. The observer records just after seeding, accounting for the few-millisecond difference between seeded budgets and measured candidate windows; its small pause remains inside the real allowance. The driver imports no source/helper implementation and invokes the shipped CLI, real plugin API, credential transport, and embedded harness.

Selected shipped CLI receipt fields (unrelated diagnostic metadata omitted; elapsed measurements above use the natural monotonic clock):

main forward #1, exit 1:
error="proof-runtime-auth credential resolution timed out at the run deadline (9250ms). Check the provider's authentication service and retry the run." errorName=AbortError

candidate forward #1, exit 1:
error="proof-runtime-auth runtime auth exchange timed out at the run deadline (9287ms). Check the provider's authentication service and retry the run." errorName=AbortError

unstepped fast control, exit 0 on both:
payloads[0].text = "AUTH-PROOF-OK"
meta.agentMeta.agentHarnessId = "openclaw"
meta.aborted = false

Exec approval followup: shipped Gateway and CLI export

The real built Gateway first handles a model-generated exec and an operator allow-once approval, recording its actual printf output. The owner then sends supported /export-trajectory, grants a second allow-once approval, and the Gateway executes the real built sessions export-trajectory CLI. Its completed exec dispatches an actual accepted agent continuation. This is the existing detached-agent caller; ordinary model exec approvals remain inline.

The local provider's continuation response remains pending for 375 seconds and emits genuine assistant content every 15 seconds. Stepped cases and the pending unstepped control use the same transport/config. The +600,000ms Date.now step occurs only after BOTH the exact owner's first wait (deadline seeded) and the actual continuation provider POST (runtime handoff consumed).

Full artifact / case Natural observation window Actual agent.wait calls Outcome
Main, forward step #1 60,004.860ms 1 observation_ended
Main, forward step #2 60,003.874ms 1 observation_ended
Candidate, forward step #1 360,017.721ms 6 observation_ended
Candidate, forward step #2 360,007.921ms 6 observation_ended
Main, identical pending transport, no step 360,013.109ms 6 observation_ended
Main, additional ordinary terminal control 3,268.046ms 1 completed
Candidate, additional ordinary terminal control 3,159.865ms 1 completed

The pending provider is still active when observation ends. The shipped warning retains the accepted agent run as sole delivery owner. Read-only inspector observations reach callExecApprovalFollowupGateway -> waitForAgentFollowupRun -> sendExecApprovalFollowup in unchanged loaded dist, and show zero calls to the direct sendMessage branch. Actual lifecycle-facade authorization and agent.wait schema validation run normally. Every wait timeout is a positive integer; the final candidate values are 59,965ms and 59,970ms.

Selected redacted runtime receipts:

{"case":"main-step-1","elapsedMs":60004.860,"outcome":"observation_ended","waitTimeoutsMs":[60000],"operatorApprovals":2,"actualContinuationPOST":true,"providerStillPending":true,"directDeliveries":0,"tracerErrors":0}
{"case":"candidate-step-1","elapsedMs":360017.721,"outcome":"observation_ended","waitTimeoutsMs":[60000,60000,60000,60000,60000,59965],"operatorApprovals":2,"actualContinuationPOST":true,"providerStillPending":true,"directDeliveries":0,"tracerErrors":0}
{"case":"unstepped-pending-control","elapsedMs":360013.109,"outcome":"observation_ended","waitTimeoutsMs":[60000,60000,60000,60000,60000,59968],"directDeliveries":0,"tracerErrors":0}

Setup-only runs that stepped before handoff consumption, or used SSE comments without real progress and hit the unchanged 300-second no-progress watchdog, are excluded. The final matrix uses matched genuine progress; no watchdog, timeout constant, owner implementation, or timer was altered.

Proof bounds and CI

This is full built-artifact CLI-local auth and WebChat/Gateway approval proof with deterministic loopback providers, not an external-provider or external-channel certification. The two Windows schtasks sites retain unit-level proof only. Managed update handoff retains the earlier source-level real-child-pipe proof only; no update was run against an installation. Owned runtime processes and state were cleaned up; no host clock or live Gateway changed.

The head remains a3e85ac. The inherited check-lint-core-2 failure was reproduced on this CI merge's exact main parent and receipted separately: #199951 (comment).

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

New full-tier shipped CLI/Gateway clock-step receipts and matched controls are posted at #199951 (comment). Head remains a3e85ac; no additional production changes. The exact-main-parent inherited CI receipt is linked in the updated PR body.

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Nov 16, 2026
@obviyus
obviyus merged commit 1e54e8b into main Nov 16, 2026
147 of 151 checks passed
@obviyus
obviyus deleted the fix/monotonic-local-deadlines branch November 16, 2026 06:15
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 1e54e8b.

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

fix: keep five local elapsed-time waits on the monotonic clock

Five local waits measured elapsed time with the wall clock, so a clock step (NTP correction, sleep/wake, manual change) ended them early or let them overrun: the exec-approval follow-up wait, the runtime auth deadline, the managed update handoff response wait, and two Windows scheduled-task waits (process exit and settlement). They now use `src/shared/monotonic-time.ts`, passing `monotonicNow` to `scheduleAbsoluteDeadline` where it's used. Epoch values that cross process, RPC or persistence boundaries stay epochs, RPC timeouts stay integers, upstream epoch auth deadlines are untouched, and the handoff `closed` command keeps its helper-owned settlement. No new text.

Evidence: full-build CLI with the process-local Date.now stepped by a preload in that process only, main twice and this change twice, plus unstepped controls. Exec-approval follow-up: main ends after about 60 s; this change waits the real ~360 s, the same as unstepped. Runtime auth: a forward step makes main expire after ~367 ms of a ~9.3 s allowance and a backward step makes it overrun to ~12.4 s; this change keeps the allowance and aborts on time. The Windows scheduled-task sites have unit-level proof with a stepped clock, and the handoff wait has source-level proof through a real child pipe. 75 consumer and 55 daemon tests pass; full build and packed smoke pass. CI red is inherited from main (receipt: openclaw#199951 (comment)). Receipts: openclaw#199951 (comment).

Supersedes the closed per-site PRs openclaw#181942, openclaw#187439, openclaw#190976, openclaw#195457, openclaw#199640 and openclaw#199665.

Co-authored-by: Ayaan Zaidi <[email protected]>
MoerAI added a commit to MoerAI/openclaw that referenced this pull request Nov 18, 2026
Main's coverage consolidation (openclaw#198936) deleted
schtasks.startup-fallback.test.ts. This branch had split that file, and
its schtasks.startup-fallback-lifecycle.test.ts held 14 cases that are
byte-identical moves of the deleted ones, so they go too. The shared
fixture support keeps only what the activation-provenance regressions
import.

Main's deadcode repair (openclaw#200313) then removed Scheduled Task fixture
helpers that had no remaining main callers. The provenance regressions
still use them, so restore those helpers verbatim
(createSchtasksNativeFixture, the task snapshot builders,
isProcessSnapshotQuery, writeNodeScript, and the probe/response types).

The settlement budget case added in openclaw#199951 asserts that restart ends
exactly at the stop budget. With this branch, restart then waits out the
15s post-/Run activation window before refusing an unverified
activation, so the restart variant now expects the stop budget plus
15s. The stop-only variants are unchanged.

Focused daemon suites: 12 files, 242 tests pass.
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed 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.

1 participant