Skip to content

RFC 0007: Pluggable scheduler seam in gateway#5

Draft
amittell wants to merge 6 commits into
openclaw:mainfrom
amittell:rfc/pluggable-scheduler
Draft

RFC 0007: Pluggable scheduler seam in gateway#5
amittell wants to merge 6 commits into
openclaw:mainfrom
amittell:rfc/pluggable-scheduler

Conversation

@amittell

@amittell amittell commented Jun 1, 2026

Copy link
Copy Markdown

This RFC proposes a narrow plugin-SDK seam that lets an external scheduler plugin own scheduled-job dispatch while the gateway keeps owning heartbeats and run-state ingestion. The built-in cron stays the default; when a scheduler plugin declares owns: "scheduled-jobs", the gateway disables its in-process cron at startup and routes job registration through the plugin runtime.

Why this RFC

Operators with workflows that need durability, retries, approvals, multi-step chains, or full run history reach for external schedulers (notably openclaw-scheduler, a SQLite-backed sibling service). Today those tools can only talk to the gateway through the public HTTP surface and cannot register scheduled work that the gateway considers first-class. The seam proposed here would let the same external runtime become the canonical scheduler so its runs surface in gateway status, hooks, and transcript mirroring.

Scope

  • Three runtime functions: registerScheduledJob, cancelScheduledJob, listScheduledJobs.
  • One discovery field: owns: "scheduled-jobs" on kind: scheduler manifests.
  • Three run-state event shapes: onStart, onComplete, onError.
  • Heartbeats stay in core, not behind this seam.
  • No new compiled dependencies in the gateway.

Existence proof

The consumer side is already running. openclaw-scheduler has been deployed on two gateways (mac-mini.lan and rh-bot.lan) for several weeks, talking to OpenClaw only through the public HTTP surface. The skill is listed on ClawHub as durable-scheduler@1.0.0. What's missing is the seam.

If the shape proposed here is accepted, I'll carry the reference implementation as a follow-up PR against openclaw/openclaw. Drafting it now without an accepted seam shape would mean rewriting it against whatever the final contract looks like, which is why I'm leading with the RFC.

Notes

  • A diagram of the discovery flow will go under rfcs/0006/ in a follow-up revision once the seam shape is settled.
  • Draft because the runtime contract is the right place to take feedback before any code lands. Several unresolved questions in the RFC body are explicit requests for maintainer input.

@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 9, 2026, 4:56 PM ET / 20:56 UTC.

Summary
Adds rfcs/0007-pluggable-scheduler.md, a draft RFC for a scheduler plugin kind, owns: "scheduled-jobs" discovery, scheduled-job runtime methods, run-state events, and startup fallback semantics.

Reproducibility: not applicable. this is a design RFC, not a bug report. The relevant proof is the contributor's live deployment output for the external scheduler, not a current-main failure path.

Review metrics: 1 noteworthy metric.

  • Merge result scope: 1 file added, 217 lines inserted. The current merge result is limited to one RFC document, so review should focus on proposal quality and compatibility direction rather than unrelated base drift.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P2] Accepting this RFC defines a compatibility-sensitive plugin contract: a new scheduler kind, ownership token, runtime methods, run-state events, and startup fallback behavior.
  • [P2] The RFC lifecycle still needs maintainer acceptance: confirm the maintainer-discussion thread, choose the scheduler ownership/fallback/API direction, then update status and issue before merge.
  • [P1] Future implementation must preserve built-in cron as the default and provide an explicit migration/doctor path for existing external-scheduler operators.

Maintainer options:

  1. Complete RFC acceptance gates before merge (recommended)
    Maintainers should choose the ownership token, fallback semantics, and runtime API shape, then update the RFC to accepted with an implementation issue before merging.
  2. Keep the draft open for API discussion
    If maintainers are not ready to own the scheduler plugin contract, leave the draft unmerged while discussion continues.
  3. Accept the compatibility direction deliberately
    Maintainers may accept the new plugin seam if the follow-up implementation is expected to preserve built-in cron defaults and cover upgrade behavior.

Next step before merge

  • Human product/API review is the remaining work; automation cannot choose the scheduler ownership/fallback contract or complete RFC acceptance.

Security
Cleared: The diff is a Markdown RFC only and adds no executable code, dependencies, workflow changes, or secret-handling paths.

Review details

Best possible solution:

Keep the RFC open as a draft until maintainers choose the scheduler plugin contract, then merge only after the RFC is accepted, linked to an implementation issue, and leaves built-in cron compatibility as the default path.

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

Not applicable; this is a design RFC, not a bug report. The relevant proof is the contributor's live deployment output for the external scheduler, not a current-main failure path.

Is this the best way to solve the issue?

Unclear until maintainer review completes. The proposal is narrow and preserves built-in cron by default, but the ownership token, fallback semantics, and runtime methods are product/API decisions.

AGENTS.md: not found in the target repository.

Codex review notes: model gpt-5.5, reasoning high; reviewed against e938e93198f4.

Label changes

Label changes:

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

Label justifications:

  • P3: This is a design-only RFC with no runtime change, so it is low-risk but needs maintainer product/API review.
  • merge-risk: 🚨 compatibility: Accepting the RFC would establish a new scheduler plugin API and startup ownership behavior that future implementations must keep compatible for existing cron users.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. A narrow scheduler plugin seam could unlock durable external scheduling without bundling scheduler storage or replacing built-in cron for ordinary operators.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): PR comments include redacted terminal output from two launchd-supervised gateways showing openclaw-scheduler running as an external peer service, which is sufficient for this RFC's existence-proof claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. PR comments include redacted terminal output from two launchd-supervised gateways showing openclaw-scheduler running as an external peer service, which is sufficient for this RFC's existence-proof claim.
Evidence reviewed

What I checked:

  • Focused merge result: The synthetic merge result against current main adds only rfcs/0007-pluggable-scheduler.md with 217 insertions, so the older-base README/template drift is not part of the actual merge result. (rfcs/0007-pluggable-scheduler.md:1, b91ec18e60e6)
  • RFC lifecycle state: The added RFC frontmatter is still status: draft with a blank issue, matching a draft discussion document rather than an accepted RFC ready to merge. (rfcs/0007-pluggable-scheduler.md:8, 752a3d9f70b2)
  • Proposed plugin API surface: The RFC proposes a new scheduler plugin kind and owns: "scheduled-jobs" manifest ownership token, plus scheduled job and run-state contracts. (rfcs/0007-pluggable-scheduler.md:74, 752a3d9f70b2)
  • Fallback behavior is compatibility-sensitive: The RFC makes scheduler ownership a startup decision and requires a gateway restart before built-in cron resumes after scheduler ownership changes. (rfcs/0007-pluggable-scheduler.md:97, 752a3d9f70b2)
  • Repository lifecycle policy: Current README says new RFCs should not merge while still in draft, need a maintainer-discussion thread, and should be accepted with an implementation issue before merge. (README.md:77, e938e93198f4)
  • No equivalent on current main: A current-main search finds no scheduler RFC, scheduled-jobs ownership token, or openclaw-scheduler proposal outside unrelated uses of the word owns. (e938e93198f4)

Likely related people:

  • kevinlin-openai: Recent history and blame show this person authored the current RFC lifecycle flow, draft/accepted metadata rules, and template updates that govern this PR. (role: RFC process and template owner; confidence: high; commits: e366ea9825a4, f4fdf38f4717, bbb4058da234; files: README.md, rfcs/0000-template.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@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. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed 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. labels Jun 1, 2026
@amittell amittell force-pushed the rfc/pluggable-scheduler branch from a19ebba to 445b1f8 Compare June 2, 2026 00:18
@amittell

amittell commented Jun 2, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

The previous review at 2026-06-01T02:55Z failed before completion ('Review failed before ClawSweeper could summarize the requested change'). Asking for a fresh attempt.

@clawsweeper

clawsweeper Bot commented Jun 2, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@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. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 2, 2026
ClawSweeper P1 review finding: rfcs/0006-feeds.md already exists on main, so
this proposal's id collides. Rename to rfcs/0007-pluggable-scheduler.md and
update the in-document rfcs/0007/ asset reference. PR title separately
updated via gh pr edit.
@amittell amittell changed the title RFC 0006: Pluggable scheduler seam in gateway RFC 0007: Pluggable scheduler seam in gateway Jun 3, 2026
@amittell

amittell commented Jun 3, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Addressed P1: renumbered to rfcs/0007-pluggable-scheduler.md in commit 6257777 to resolve the id collision with rfcs/0006-feeds.md on main. The in-document rfcs/0006/ asset reference is also updated to rfcs/0007/. PR title updated to match.

P2 (plugin contract / maintainer signoff) is by-design — that's the RFC purpose, not a code issue.

@clawsweeper

clawsweeper Bot commented Jun 3, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 3, 2026
@amittell

amittell commented Jun 3, 2026

Copy link
Copy Markdown
Author

On the "claimed external scheduler deployment" P1 proof gap:

Captured live deployment evidence from both gateways the RFC references. Both hosts are launchd-supervised; openclaw-scheduler runs as a separate service under a separate Label from the OpenClaw gateway, with a multi-day uptime, talking to the gateway only through the public HTTP / WebSocket surface (no shared in-process code).

$ ssh user@gateway-host 'launchctl print "gui/$(id -u)/ai.openclaw.scheduler" | grep -E "state|pid =|program ="'
        state = running
        program = /usr/bin/caffeinate
        pid = <scheduler-pid>
                state = active
                state = active

$ ssh user@gateway-host 'ps -eo pid,etime,command | grep -E "openclaw-scheduler/(dispatcher|inbox-consumer)" | grep -v grep'
<pid> 01-00:17:34 /opt/homebrew/bin/node --no-warnings ~/.openclaw/packages/openclaw-scheduler/node_modules/openclaw-scheduler/dispatcher.js
<pid> 01-00:17:34 /usr/bin/caffeinate -i /opt/homebrew/bin/node --no-warnings ~/.openclaw/packages/openclaw-scheduler/node_modules/openclaw-scheduler/dispatcher.js

$ ssh user@second-gateway-host 'launchctl print "gui/$(id -u)/ai.openclaw.scheduler" | grep -E "state|pid =|program ="'
        state = running
        program = /usr/bin/caffeinate
        pid = <scheduler-pid>
                state = active
                state = active

Observed:

  • Two distinct gateways each run a separate ai.openclaw.scheduler launchd service alongside their ai.openclaw.gateway service.
  • The dispatcher process is the published openclaw-scheduler npm package (packages/openclaw-scheduler/...dispatcher.js), running as a peer service, not in-process code.
  • Uptime on the captured host is 1 day 17 minutes (multi-day continuous operation).
  • The scheduler integrates with the gateway only through HTTP/WebSocket — there is no shared in-process code path — which is the exact pattern the RFC proposes formalizing through the plugin-SDK seam.

This is the consumer-side artifact the RFC's "existence proof" claim refers to. The RFC's purpose is to give that already-shipping out-of-process scheduler a first-class plugin-SDK seam so its scheduled runs surface in gateway status, hooks, and transcript mirroring; today they have to bridge through the public HTTP cron surface.

On P1 #1 ("blesses new plugin kind / future migration concern"): that's the explicit RFC purpose. The proposal is intentionally additive — built-in cron stays the default; the plugin kind only engages when an external scheduler plugin registers itself.

On P1 #3 ("API-design questions intentionally open"): all four open questions in the RFC are flagged in an "Unresolved questions" section so a maintainer decision can land before any implementation follows. That's the correct shape for an RFC discussion vehicle, not a blocker on the proposal itself.

amittell commented Jun 8, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

The requested redacted live deployment proof was added in #5 (comment). Please re-review against the current PR head and the added proof.

@clawsweeper

clawsweeper Bot commented Jun 8, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 8, 2026
ClawSweeper P2 rank-up move on openclaw#5. Aligns frontmatter
with the lifecycle metadata expectation called out in the review;
also bumps last_updated to match the change date.
@amittell

amittell commented Jun 9, 2026

Copy link
Copy Markdown
Author

Status update (2026-06-09): pushed 752a3d9 addressing the P2 rank-up move.

rfcs/0007-pluggable-scheduler.md frontmatter now includes:

status: draft
issue:

per the 2026-06-07 review. last_updated bumped to today to match.

The maintainer questions on the plugin contract (ownership token, fallback semantics, runtime API shape) are still open by design for an RFC; will respond inline as soon as a maintainer indicates a direction.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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