fix: ensureWorkflowCrons creates missing crons instead of skipping all#323
Open
funsaized wants to merge 1 commit intosnarktank:mainfrom
Open
fix: ensureWorkflowCrons creates missing crons instead of skipping all#323funsaized wants to merge 1 commit intosnarktank:mainfrom
funsaized wants to merge 1 commit intosnarktank:mainfrom
Conversation
When some agent crons were deleted (e.g. during troubleshooting) but others survived, workflowCronsExist() returned true and ensureWorkflowCrons() skipped creating ALL crons. This caused missing agent crons to never get recreated, leaving workflow steps stuck at 'pending' forever. Changes: - Replace workflowCronsExist() with getExistingCronAgentIds() that returns the set of agent IDs with existing crons - ensureWorkflowCrons() now compares expected vs existing agent crons and creates only the missing ones - setupAgentCrons() accepts an optional onlyAgentIds filter set, preserving the original stagger timing for all agents Fixes snarktank#322
|
@funsaized is attempting to deploy a commit to the Ryan Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Fixes #322 —
ensureWorkflowCronsnow creates only missing agent crons instead of skipping all creation when any cron exists.Problem
workflowCronsExist()used.some()to check if any cron existed for a workflow. If some crons were deleted during troubleshooting but others survived, the function returnedtrueandensureWorkflowCrons()skipped creating all crons. Missing agent crons were never recreated, causing workflow steps to get stuck at "pending" forever.This was observed on a
competitive-intel-scannerworkflow (8 agents) where thelandscapercron was missing butproduct-scannerstill existed.Changes
workflowCronsExist()withgetExistingCronAgentIds()that returns the set of agent IDs that already have cronsensureWorkflowCrons()now compares expected agent IDs (from the workflow spec) against existing cron agent IDs and creates only the missing onessetupAgentCrons()accepts an optionalonlyAgentIdsfilter set so it can skip agents that already have crons while preserving the original index-based stagger timingTesting
npm run build