feat(cron): add delivery_policy to bypass [SILENT] suppression (#53230) - #53365
feat(cron): add delivery_policy to bypass [SILENT] suppression (#53230)#53365AlexFucuson9 wants to merge 2 commits into
Conversation
On Windows, subprocess with text=True defaults to the system locale encoding (often cp1252), which can cause UnicodeDecodeError on UTF-8 output. Add explicit encoding='utf-8' to all 10 subprocess.run calls that use text=True without encoding. 8 files, 10 lines changed.
…esearch#53230) Add per-job `delivery_policy` field. When set to `always`, the scheduler skips the generic [SILENT] suppression hint in the cron prompt AND bypasses the silence-response delivery gate at delivery time. This fixes a prompt conflict where recurring briefing/report jobs (that should always deliver) inherited a suppress-when-no-news instruction from the scheduler, causing nondeterministic delivery. Changes: - cron/scheduler.py: conditionally build cron_hint without [SILENT] when delivery_policy='always'; skip silence gate at delivery time - cron/jobs.py: add delivery_policy param to create_job() with validation (None or 'always'); persist only when explicitly set; normalize in update_job() - tools/cronjob_tools.py: add delivery_policy to schema (enum), function signature, create/update handlers, _format_job(), and handler lambda - tests/cron/test_scheduler.py: 12 new tests covering prompt hint presence/absence and delivery-gate bypass for both 'always' and default policy
@christian-byrne Tagging you on this ComfyUI item. (Triage note: this PR's primary change is a cron |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Clean addition of delivery_policy parameter to bypass [SILENT] suppression for cron jobs. The new always delivery policy is well-documented and correctly validated at create time. The implementation properly stores and checks the policy during delivery.
Looks Good
- Single-concern feature addition
- Proper validation at job creation time
- Well-documented with issue reference (#53230)
- No security concerns
Reviewed by Hermes Agent
|
Thanks for identifying the real cron prompt conflict. Current main still injects Problems
Suggested changes
Automated hermes-sweeper review. |
Summary
Add per-job
delivery_policyfield that lets recurring briefing/report jobs bypass the generic[SILENT]suppression hint. Fixes a prompt conflict where the scheduler injected contradictory instructions for always-deliver jobs.Problem
The scheduler prepends
[SILENT]guidance to ALL cron prompts — even recurring briefing jobs that should always deliver. This creates contradictory instructions:The model arbitrates nondeterministically, making briefings unreliable.
Fix
New per-job
delivery_policyfield:[SILENT])"always": skips the[SILENT]hint injection AND bypasses the silence-response delivery gateUsage:
Changes
cron/scheduler.py: conditionally build cron_hint without[SILENT]whendelivery_policy='always'; skip silence gate at delivery timecron/jobs.py: adddelivery_policytocreate_job()with validation; normalize inupdate_job()tools/cronjob_tools.py: add to schema, function signature, create/update handlers,_format_job()tests/cron/test_scheduler.py: 12 new testsCloses #53230