Repository navigation
fix(routines): refuse duplicate and excess routines in schedule_create - #2232
Merged
Merged
Conversation
schedule_create made a new routine on every call, so a bot that retried or looped could stack identical unattended routines. It now refuses a name that matches an active routine of the bot in the same thread, giving that routine's id, and refuses a new routine once the bot has 50 active.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
[Medium impact] The PR appears safe to merge. Summary
Reviews (2) · Last reviewed commit: "test(routines): check the active-routine..." · Reviewed by Greptile |
This branch was previously 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.
Why
schedule_createmade a new routine on every call, so a bot that retried or looped could stack identical unattended routines, each a model run on its own schedule.What changed
In the tool path only (the routines UI and agent import are unchanged):
schedule_updatein a group only reaches the current thread's routines.This is a soft limit:
schedule_updatecan still rename or reactivate past it, and two parallel calls can both pass the check.Not included: a minimum interval for model routines.
every: 1, unit: minutesis still allowed, while watches are already held to 5 minutes.How tested
Added unit tests for the name match, a same name in another thread, and the cap; they fail without the change. Updated the schedule and fleet mocks. The Postgres journeys suite, typecheck and Biome pass. Backup-script and desktop-preparation tests fail on macOS without this change too.