Skip to content

fix(sleep): schedule forwards --scope to the scheduled run - #413

Open
Aditya Nikam (adityaanikam) wants to merge 1 commit into
microsoft:mainfrom
adityaanikam:fix-schedule-forwards-scope-405
Open

Aditya Nikam (adityaanikam) wants to merge 1 commit into
microsoft:mainfrom
adityaanikam:fix-schedule-forwards-scope-405

Conversation

@adityaanikam

Copy link
Copy Markdown
Contributor

Fixes #405.

cmd_schedule read --scope but never passed it on, and _runner_cmd wrote --scope invoked into every scheduled command. So schedule --scope all installed a nightly job that harvested only the invoked project. schedule() now takes a scope argument that defaults to "invoked", and cmd_schedule passes args.scope through. _runner_cmd refuses any value other than invoked or all. Callers that do not pass a scope, such as the openclaw plugin, get the same command as before.

Two new tests in tests/test_sleep_scheduler_safety.py: the command carries the requested scope (the default is unchanged), and an unknown scope is refused before anything is written to crontab. Both fail on main and pass here. The first only runs on POSIX, like the quoting test next to it, so I ran the file on Linux as well as Windows.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

schedule: --scope is silently dropped from the generated cron entry

2 participants