Skip to content

feat(cron): add delivery_policy to bypass [SILENT] suppression (#53230) - #53365

Open
AlexFucuson9 wants to merge 2 commits into
NousResearch:mainfrom
AlexFucuson9:fix/cron-delivery-policy-silent-opt-out
Open

feat(cron): add delivery_policy to bypass [SILENT] suppression (#53230)#53365
AlexFucuson9 wants to merge 2 commits into
NousResearch:mainfrom
AlexFucuson9:fix/cron-delivery-policy-silent-opt-out

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

Summary

Add per-job delivery_policy field 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:

  • Job prompt: "always send a concise report, even an all-clear"
  • Scheduler: "if nothing new, say [SILENT] to suppress delivery"

The model arbitrates nondeterministically, making briefings unreliable.

Fix

New per-job delivery_policy field:

  • unset/default: standard behaviour (agent may return [SILENT])
  • "always": skips the [SILENT] hint injection AND bypasses the silence-response delivery gate

Usage:

cronjob(action='create', schedule='0 9 * * *', 
        prompt='Send daily briefing', delivery_policy='always')

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 to create_job() with validation; normalize in update_job()
  • tools/cronjob_tools.py: add to schema, function signature, create/update handlers, _format_job()
  • tests/cron/test_scheduler.py: 12 new tests

Closes #53230

annguyenNous and others added 2 commits June 26, 2026 15:08
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
@alt-glitch alt-glitch added type/feature New feature or request comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists labels Jun 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

@christian-byrne Tagging you on this ComfyUI item.

(Triage note: this PR's primary change is a cron delivery_policy opt-out for the [SILENT] suppression — root cause #53230. It bundles an unrelated skills/creative/comfyui/scripts/auto_fix_deps.py edit plus several other files not described in the body; flagging the ComfyUI touch per ownership. It's a competing approach to the allow_silent cluster #53248/#53270/#53252related_to, not a duplicate; maintainer picks the API shape.)

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the real cron prompt conflict. Current main still injects [SILENT] for every job at cron/scheduler.py:2263-2276 and suppresses recognized successful silence responses at cron/scheduler.py:3493-3509.

Problems

  • The bypass in PR commit af619615579f applies to every silence marker. That would deliver scheduler control markers: run_job() returns SILENT_MARKER for no-agent wakeAgent=false and empty stdout at cron/scheduler.py:2574-2598, and for an agent pre-run wake gate at cron/scheduler.py:2636-2647.
  • The added tests mock run_job() to return [SILENT], so they do not cover those internal-marker paths.
  • The field is not available through existing direct cron interfaces: CLI forwarding is at hermes_cli/cron.py:301-313 and :364-376; dashboard creation is at hermes_cli/web_server.py:10032-10045 and :10352-10368; API-server update filtering is at gateway/platforms/api_server.py:3567.

Suggested changes

  • Distinguish scheduler-generated silence from an agent-authored silence response, and test all three internal-silence paths.
  • Decide and wire the intended public creation/edit surfaces, including persistence round trips.
  • Keep the unrelated dc37bbc5f4e9 subprocess-encoding changes separate from this cron-policy salvage.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Generic cron [SILENT] prompt policy suppresses recurring briefing/report jobs that should always send an all-clear

5 participants