Skip to content

feat(cron): add script_only mode to bypass LLM entirely#17601

Closed
Znarkus wants to merge 1 commit into
NousResearch:mainfrom
Znarkus:feature/cron-script-only-mode
Closed

feat(cron): add script_only mode to bypass LLM entirely#17601
Znarkus wants to merge 1 commit into
NousResearch:mainfrom
Znarkus:feature/cron-script-only-mode

Conversation

@Znarkus

@Znarkus Znarkus commented Apr 29, 2026

Copy link
Copy Markdown

Summary

When a cron job has script_only=true and a script configured, the script stdout is delivered directly as the final message — no LLM is invoked at all.

This saves tokens and ensures 100% consistent formatting for jobs where the script already produces the final user-facing output. The [SILENT] marker still works to suppress delivery.

Changes

  • cron/scheduler.py — Early return in run_job() for script_only jobs: runs the script via _run_job_script() and returns output directly
  • cron/jobs.pyscript_only: bool parameter in create_job(), persisted in the job dict
  • tools/cronjob_tools.py — Schema property, handler wiring, create/update support, formatted output

Usage

# Create a script-only cron job (no LLM, no tokens)
cronjob(action='create', script='my_check.py', script_only=True, schedule='0 * * * *', name='Hourly check')

# Update existing job to script-only
cronjob(action='update', job_id='abc123', script_only=True)

25 lines added, 0 removed.

When a cron job has script_only=true and a script configured, the script
stdout is delivered directly as the message without invoking an LLM.

This saves tokens and ensures consistent formatting for jobs where the
script already produces the final user-facing output (e.g. email checks,
surf forecasts). [SILENT] marker still works to suppress delivery.

Changes:
- scheduler.py: early return in run_job() for script_only jobs
- jobs.py: script_only parameter in create_job()
- cronjob_tools.py: schema, handler, create/update support
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cron Cron scheduler and job management labels Apr 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

This looks implemented on current main under the no_agent name. This is an automated hermes-sweeper review.

Evidence:

  • cron/scheduler.py:1418 short-circuits run_job() for job.get("no_agent"), runs the configured script, returns stdout directly, and skips the agent/model path entirely.
  • cron/jobs.py:567 and cron/jobs.py:682 add and persist the no_agent job field, with validation that script-only jobs have a script.
  • tools/cronjob_tools.py:797 exposes no_agent in the cronjob tool schema, and tools/cronjob_tools.py:684 wires update support with script validation.
  • tests/cron/test_cron_no_agent.py:264 asserts the no-agent path never invokes run_agent.AIAgent; nearby tests cover stdout delivery, silent output, wakeAgent=false, and script failure alerts.
  • Landed in 3db6b9cc871c6f1c588cccba1ff2bd09601c1b77 (feat(cron): add no_agent mode for script-only cron jobs (watchdog pattern) (#19709)), which is contained in v2026.5.7.

The only notable difference is naming: main uses no_agent=True rather than this PR's proposed script_only=True, but the behavior requested here is present.

@teknium1 teknium1 closed this Jun 10, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 10, 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 P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants