Skip to content

fix(cron): preserve runs and pacing through unrelated MCP reloads - #192399

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-config-patch-revokes-unrelated-run-admission-20260919
Nov 4, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-config-patch-revokes-unrelated-run-admission-20260919

Conversation

@steipete

@steipete steipete commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes scheduled session turns failing during preparation after an unrelated mcp.servers.* config patch, then losing their accepted next_check cadence until the next daily slot.

User Impact

Scheduled turns on the OpenClaw runtime continue through unrelated MCP server edits. Failed paced checks retain their pending occurrence through normal error backoff and Gateway restart. No configuration or schema changes are required.

Why This Change Was Made

Run admission was comparing MCP server configuration even when the selected runtime already delegates connection authority to the MCP owner. The policy now uses the runtime facts selected upstream: OpenClaw-owned connections retain exact-instance revocation, while CLI and other native runtimes that receive raw MCP config keep their existing checks. Potentially effectful work is never blindly replayed.

The cron owner now retains a due paced occurrence until it succeeds or is disabled. This removes the redundant expiry guard and its special-case plumbing. Production code grows by 26 lines to carry selected runtime facts and preserve failed occurrence ownership; no cache, new generation, or retry wrapper is added. The local type-import repair matches the fix subsequently landed on main in dbecd55.

Evidence

  • Clean parent 9038857e7327bafc88b6bc716784ffcc451eb38f: all four new behavioral regressions fail. Candidate: full pnpm build passes; 217 focused tests pass, including MCP connection retirement, scheduled admission/readmission, prefix stability, paced failure/restart, and force-run ownership.
  • Real isolated Gateway, two existing sessions, real cron scheduling and automations.next_check, loopback model, actual config.patch during native preparation: parent produces two authority errors and next checks about 86,372 seconds away; candidate completes both and keeps their 3-second next checks. Preparation counts prove no extra admission/replay.
  • Codex autoreview: scoped-clean through P2, including the final diff. pnpm check:changed --base HEAD completed. Its typecheck and proof-script lint findings were fixed; core, all core-test shards, script typechecks, and targeted script lint now pass. The only remaining failure is four untouched node-plugin snapshot exports, reproduced by the same production Knip scan on exact parent 9038857 and introduced by e0ac337 / feat: let node-hosted MCP tools ask questions through the Gateway #191589. This is an inherited main regression, not a waived PR defect.
  • Reproducible synthetic proof scripts are included. No production data or credentials are used. Synthetic scale is 5,000 sessions / 35 GiB SQLite and 62,000 files / 1.116 GB; owner timing excludes fixture setup. Host filesystem is APFS, so this does not claim btrfs equivalence.

Successful-policy timing control: 38.752→39.649 µs wall and 38.425→39.263 µs thread CPU; the ~2.3% change is within ~4.9% A/A drift. Under the MCP patch, parent incorrectly rejects all 125,000 checks at 26.172 µs while candidate retains all at 41.763 µs; those different outcomes are not an optimization comparison.

Equal successful-check sampled allocation: 50,073→50,733 B/check (+1.32%); changed-MCP early-refusal versus completed validation: 32,899→53,848 B/check. Five A/B pairs plus two A/A pairs cover the changed publication; three A/B pairs cover equal successful work.

…oads

Delegate MCP server authority to the selected in-process runtime owner while retaining raw-config checks for other runtimes. Keep failed paced occurrences through error backoff and restart instead of advancing to the next daily slot.

Prove the regression on the original main parent and through an isolated Gateway with actual config.patch and next_check calls. Preserve exact MCP connection revocation and avoid replaying effects.
@clawsweeper

clawsweeper Bot commented Nov 3, 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 docs Improvements or additions to documentation scripts Repository scripts agents Agent runtime and tooling size: L labels Nov 3, 2026
@steipete
steipete marked this pull request as ready for review November 4, 2026 00:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 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-11-04T00:02:51.158799Z 0ada22a 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.

@steipete
steipete merged commit aa49c2b into main Nov 4, 2026
217 of 221 checks passed
@steipete
steipete deleted the steipete/perf-micro-config-patch-revokes-unrelated-run-admission-20260919 branch November 4, 2026 00:11
@steipete

steipete commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…oads (openclaw#192399)

Delegate MCP server authority to the selected in-process runtime owner while retaining raw-config checks for other runtimes. Keep failed paced occurrences through error backoff and restart instead of advancing to the next daily slot.

Prove the regression on the original main parent and through an isolated Gateway with actual config.patch and next_check calls. Preserve exact MCP connection revocation and avoid replaying effects.
vincentkoc added a commit that referenced this pull request Nov 4, 2026
* commit 'b4ebd3673fea4932296b92bbc07b7abc4bdc792d':
  fix(ci): allow serial SDK API reports to finish (#192196)
  fix(ci): run PostgreSQL checks when its shard planner changes (#191963)
  fix(ci): model native Linux updater asset entry
  improve(test): speed up config and device binding browser tests (#192404)
  improve(ui): show arrivals top right with a contextual session status (#192016)
  improve(ui): mark error toasts and split two-sentence copy (#192015)
  fix(sandbox): give dependency builders a writable home (#192390)
  fix(worktrees): keep archive manifest checks off the main thread (#192358)
  fix(cron): preserve admitted runs and pacing across unrelated MCP reloads (#192399)
  improve(ui): stack toasts in a center lane and an arrivals lane (#192014)
  fix: reclaim abandoned read-only database snapshots (#192368)
  improve(ui): rebuild the toast on one component with variants and a hover dismiss (#192013)
  docs: consolidate team server and team setup into one Multiplayer page
  fix(ci): reconcile remaining unallocated test lines
  feat: run admitted MCP tools on the worker node that hosts them (#191387)
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…oads (openclaw#192399)

Delegate MCP server authority to the selected in-process runtime owner while retaining raw-config checks for other runtimes. Keep failed paced occurrences through error backoff and restart instead of advancing to the next daily slot.

Prove the regression on the original main parent and through an isolated Gateway with actual config.patch and next_check calls. Preserve exact MCP connection revocation and avoid replaying effects.

Source: aa49c2b

Release adaptation: Bounded pacing cutover across all seven scheduler/service owners plus restart regression. Excluded MCP configuration policy/fingerprints, perf harness, docs and allocations. Baseline occurrences were discarded when expired and natural schedule replaced error retries. Later occurrence-authority refactor is not required for this bounded preservation; preserved existing authority checks. Formatting passed; owner runtime proof unavailable due reproduced compiled-worker preparation timeout and unsupported external declaration install. No schema changes.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit af3400de2db9cf8b7b5ed4afa371f66748940b0f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant