Repository navigation
fix(cron): disable jobs whose channel cannot deliver - #137
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
A cron row aimed at a missing channel ran the agent, then cron_send failed and skipped ack, so next_run stayed due and the same tools ran on every poll. Reject that channel at create time and disable an already stored row before agent_run.
This branch has not been deployed
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.
Bug and impact
A cron job aimed at a channel that cannot deliver (unknown name, Telegram/Discord/WebChat left disabled, or the
cronchannel itself) still ran the full agent.cron_sendthen failed, ack was skipped, andnext_runstayed in the past, so the same model turn and its tools ran again on every poll. That repeats shell, file, and hardware side effects until the job is deleted.Root cause
cron_create_jobstored any channel string.cron_polloffered the due row,handle_messagecalledagent_run, and only then didcron_sendnotice the target channel was missing.Fix
-2when the channel has no send path. The cron tool andPOST /api/cronreportchannel cannot deliver.cron_job_set_enabled, not a toggle) before the agent runs, and logs the job id and channel.clijob still fires.Validation
test_unregistered_channel_is_not_deliveredfailed before the fix (pollreturned the ghost job) and passes after it../build/test_cronand./build/test_dispatchpass.