fix(cron): classify local script timeouts separately - #61969
Conversation
|
@kshitijk4poor Could you please approve the fork workflow and review this focused cron bug fix when convenient? It distinguishes local pre-run script timeouts from provider failures. The isolated local cron suite passed: 678 tests, with the live cron registry unchanged during testing. |
|
Thanks for the focused cron fix. The premise is verified on current main: The new precedence branch is narrow, preserves the existing provider classifications, and the PR covers both direct classifier behavior and the Automated hermes-sweeper review. |
|
Closing with credit — and a credit correction. The explicit "Script timed out after Ns" classification landed on main via PR #85536 (cherry-picked from #82460), but your PR was the EARLIEST submission of this exact fix — Jul 10, a month ahead. Our duplicate sweep missed it ("local script timeouts" phrasing); apologies for the misattributed first credit. The merged branch order matches your design: script contract before broad provider-keyword checks. Thanks! |
What does this PR do?
Cron delivery summaries can misclassify a local pre-run script timeout as a provider failure.
_run_job_script()emits an exact envelope such asScript timed out after 120s: ..., but broad keyword checks for429,rate limit, andtimeoutcan shadow the real cause when those terms appear in the script path or error text.This change classifies the exact local-script timeout envelope before provider/API keyword checks. Provider timeout and rate-limit behavior remains unchanged for genuine provider failures.
No matching open/closed issue or pull request was found in the pre-submission search.
Related Issue
No linked issue.
Type of Change
Changes Made
cron/scheduler.py: classify the exact local script-timeout envelope before broad provider-keyword checks.tests/cron/test_scheduler_failure_summary.py: add precedence and sanitization regressions for integer/decimal local timeouts, paths containing429/rate-limit, genuine provider timeouts, and generic script failures.tests/cron/test_cron_script.py: add an integration regression from_run_job_script()timeout output through the delivery-summary classifier.How to Test
python -m pytest -o 'addopts=' -q tests/cron/test_scheduler_failure_summary.py.python -m pytest -o 'addopts=' -q tests/cron/test_cron_script.py.python -m pytest -o 'addopts=' -q tests/cronwith an isolated process-levelHOME,HERMES_HOME, XDG config/cache paths, andTMPDIR.Local verification on macOS:
py_compile: passedgit diff --check: passedChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passThe full repository test suite was not run locally. The complete
tests/cronsuite was run and passed as documented above.Documentation & Housekeeping
docs/, docstrings) — N/A; behavior is internal and covered by code comments/testscli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Not applicable. The change affects text classification in cron failure delivery summaries and is covered by focused and integration regression tests.