fix(cron): don't log "agent returned [SILENT]" when the agent was never invoked#42107
Open
sanidhyasin wants to merge 1 commit into
Open
fix(cron): don't log "agent returned [SILENT]" when the agent was never invoked#42107sanidhyasin wants to merge 1 commit into
sanidhyasin wants to merge 1 commit into
Conversation
…er invoked When a tick is short-circuited before the LLM runs — a `wakeAgent=false` script gate, empty no_agent script output, or a prompt that resolves to nothing — run_job returned the same SILENT_MARKER as a genuine agent-produced `[SILENT]` reply. The delivery loop then logged "agent returned [SILENT] — skipping delivery", which is misleading: the agent was never called this tick. Introduce a distinct AGENT_NOT_INVOKED_MARKER sentinel returned by the four pre-agent skip paths. It suppresses delivery exactly like SILENT_MARKER, but lets the delivery loop log "agent not invoked — skipping delivery" instead. The genuine agent-returned-[SILENT] path is untouched and keeps its existing log line. Fixes NousResearch#41923
tonydwb
approved these changes
Jun 9, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Looks Good
- Fixes incorrect log message: when cron agent is never invoked (wake gate returns false), the system now logs "agent not invoked" instead of falsely logging "agent returned [SILENT]".
- Renames
SILENT_MARKERtoAGENT_NOT_INVOKED_MARKERfor clarity. - No security concerns, no debug artifacts.
Reviewed by Hermes Agent
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.
What & why
Closes #41923.
When a cron tick is short-circuited before the LLM is ever invoked, the scheduler logs a misleading line claiming the agent ran:
The root cause: four pre-agent skip paths in
run_joball returned the sameSILENT_MARKERthat a genuine agent-produced[SILENT]reply uses, so the delivery loop in_process_jobcouldn't tell the two apart and always loggedagent returned [SILENT].The skip paths are:
wakeAgent=falsescript gate (LLM path) — the case in the issuewakeAgent=falsegate on ano_agentjobno_agentscript stdoutIn all four the agent is never invoked.
Change
Add a distinct
AGENT_NOT_INVOKED_MARKERsentinel returned by those four skip paths. It suppresses delivery exactly likeSILENT_MARKER(output is still saved for audit, the run still counts as a success), but lets the delivery loop log:The genuine "agent ran and replied
[SILENT]" path is untouched and keeps its existingagent returned [SILENT] — skipping deliverylog line. The two markers are mutually exclusive ([SILENT]is not a substring of[SILENT:agent-not-invoked]), so the substring[SILENT]detection for real agent replies still works.This keeps the per-cause line already emitted inside
run_job(wakeAgent=false, skipping agent run,empty stdout — silent run, etc.) as the authoritative reason, and stops the second line from contradicting it.How to test
Repro from the issue: a cron job whose pre-run script emits
{"wakeAgent": false}. Before this change the scheduler loggedagent returned [SILENT] — skipping delivery; now it logsagent not invoked — skipping delivery.Automated:
test_run_job_no_agent_empty_output_is_silent,test_run_job_no_agent_wake_gate_is_silent, andtest_wake_false_skips_agent_and_returns_silentto assert the new sentinel.test_agent_not_invoked_marker_logs_distinct_messageasserting the skip path logsagent not invokedand notagent returned, while still suppressing delivery.All 404 tests in
tests/cron/pass.Platforms
Logic-only change in
cron/scheduler.py; no platform-specific code touched. Tested on macOS.