feat(cron): auto-disable usercron jobs on success#818
Conversation
99e406d to
f8d3d16
Compare
OpenAB PR ScreeningThis is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Screening report## IntentPR #818 tries to let The operator-visible problem: today, a goal-oriented scheduled job can keep running even after it has succeeded, causing repeated agent runs, noise, wasted compute, and possible repeated Discord/thread activity. This PR adds a completion check so a job can prove success and then persist FeatFeature. Behaviorally, It also persists Who It ServesPrimary beneficiary: agent runtime operators and deployers running goal-driven scheduled jobs. Secondary beneficiaries: maintainers and reviewers, because completed recurring work becomes explicit state instead of ambient scheduler behavior. Rewritten PromptImplement goal-completion auto-disable for Add optional disable_on_success = "command"
disable_on_success_match = "required output marker"
disable_on_success_timeout_secs = 120
disable_on_success_working_dir = "/path"Before running the normal cron prompt, execute the completion command when configured. Treat the goal as complete only if the command exits Persist scheduler writebacks atomically where possible, avoid affecting non-usercron config, and add focused tests for success, missing marker, nonzero exit, timeout, missing Merge PitchThis is worth advancing because it closes a real scheduler lifecycle gap: goal-driven jobs need a first-class way to stop themselves after success. Risk profile is moderate. The behavior touches scheduler execution and config persistence, so reviewer concern will likely center on writeback safety, race conditions, TOML preservation, and whether shell-command success checks are too footgun-prone. The PR is directionally useful, but the large Best-Practice ComparisonOpenClaw principles that apply:
Hermes Agent principles that apply:
Implementation OptionsConservative option: merge only the config fields, completion check, and skip behavior, but do not write back Balanced option: keep the PR’s core behavior, but harden writeback. Require stable Ambitious option: introduce a durable scheduler state layer separate from the user-authored TOML. Store job completion, thread routing, run history, retry state, and disable reasons in a scheduler-owned state file or database. This aligns better with OpenClaw/Hermes long-term patterns but is larger than this PR. Comparison Table
RecommendationAdvance the balanced path. The feature solves a concrete lifecycle problem and matches the direction of gateway-owned scheduling, but merge discussion should focus on making persistence boring: stable If the current PR does not already guarantee safe writeback semantics, split that hardening into the required follow-up before merge rather than treating it as optional polish. |
Summary
disable_on_successcompletion checks requiring both exit code 0 anddisable_on_success_matchin output$HOME/.openab/cronjob.tomlby stableid(enabled = falseon success,thread_idafter thread creation)Behavior
[[jobs]]entries in usercron may define:A goal is complete only if the command exits
0and stdout/stderr contains the configured marker. Plain exit0without the marker continues the normal cron prompt.Tests
git diff --checkcargo test cron --lib(cargois not installed in this environment)Discord thread: https://discord.com/channels/1491295327620169908/1504239931940409587