Skip to content

fix(routines): refuse duplicate and excess routines in schedule_create - #2232

Merged
elie222 merged 2 commits into
elie222:mainfrom
tc3oliver:fix/schedule-create-limits
Oct 26, 2026
Merged

elie222 merged 2 commits into
elie222:mainfrom
tc3oliver:fix/schedule-create-limits

Conversation

@tc3oliver

Copy link
Copy Markdown
Contributor

Why

schedule_create made 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):

  • A name matching an active routine of the bot in the same thread (case-insensitive) is refused, and the error gives that routine's id. The match is per thread because schedule_update in a group only reaches the current thread's routines.
  • A bot with 50 active routines can't create another.

This is a soft limit: schedule_update can 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: minutes is 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.

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.
@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
rakazo-www Skipped Skipped Oct 25, 2026 11:55pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

schedule_create now rejects duplicate active names within a thread and refuses creation when a bot has 50 active routines.

  • Routine creation refuses duplicate names and bots with 50 active routines.

Reviews (2) · Last reviewed commit: "test(routines): check the active-routine..." · Reviewed by Greptile

@elie222
elie222 merged commit a384a72 into elie222:main Oct 26, 2026
28 checks passed
@tc3oliver
tc3oliver deleted the fix/schedule-create-limits branch November 13, 2026 05:07

This branch was previously deployed

1 inactive deployment
Preview — 78072320 Deployed Oct 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants