Add script_skip_if_empty for cron jobs with pre-run scripts - #10855
Closed
cola-runner wants to merge 2 commits into
Closed
cola-runner wants to merge 2 commits into
cola-runner wants to merge 2 commits into
Conversation
cola-runner
marked this pull request as ready for review
April 16, 2026 08:06
Contributor
Contributor
23 tasks
cola-runner
force-pushed
the
codex/fix-10656-cron-skip-empty-script
branch
from
April 27, 2026 03:06
16aabe3 to
7db02d7
Compare
19 tasks
Collaborator
|
Thanks for the focused cron work. This is already implemented on current
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds an opt-in
script_skip_if_emptyflag for cron jobs with pre-run scripts.Right now a cron job always goes on to invoke the LLM after the script runs, even when the script exits successfully with empty stdout. That makes change-detection style jobs noisy and wastes model calls when there is nothing to report.
With this change:
script_skip_if_empty: truerun_job()returns early without creating anAIAgentfinal_responseis emptyThe default behavior is unchanged. If the flag is not set, empty script output still follows the existing path and the LLM receives the "no output" notice in the prompt.
The change is wired through all three layers:
cron/jobs.pystores the flag on the jobcron/scheduler.pyperforms the early skip and avoids running the script twicetools/cronjob_tools.pyexposes the flag on create/update/listI also added regression coverage for:
Testing
source venv/bin/activate && python -m pytest tests/cron/test_cron_script.py -qsource venv/bin/activate && python -m pytest tests/cron/test_scheduler.py -qsource venv/bin/activate && python -m pytest tests/tools/test_cronjob_tools.py -qsource venv/bin/activate && python -m pytest tests/ -qThe targeted cron tests pass.
The full local suite is still not green on this checkout/environment (
68 failed, 11771 passed, 98 skipped, 60 errors), but the failures are outside this change and match the broader ACP / optional Discord / web-server / gateway noise already present locally.