Repository navigation
fix(sleep): find Windows scheduled tasks listed with their folder path - #397
Open
Muhammad Abdullah Butt (1AbdullahButt) wants to merge 1 commit into
Open
Muhammad Abdullah Butt (1AbdullahButt) wants to merge 1 commit into
Muhammad Abdullah Butt (1AbdullahButt) wants to merge 1 commit into
Conversation
schtasks /query /fo csv prints each task's full path, so the task that `schedule` creates as SkillOpt-Sleep-<digest> is listed as \SkillOpt-Sleep-<digest> and never matched the prefix check. list_scheduled() was always empty on Windows, and `unschedule --all` deleted nothing while reporting "Removed all scheduled tasks." Strip the leading backslash before matching. Fixes microsoft#396 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #396
_list_win_taskskeeps rows ofschtasks /query /fo csvwhose name starts withSkillOpt-Sleep-.schtasksprints the full task path, so the root-folder task thatschedulecreates is listed as\SkillOpt-Sleep-<digest>and never matched. As a result, on Windows:list_scheduled()was always empty, soschedulenever showed the "currently scheduled" list.unschedule --alldeleted nothing but still printed "Removed all scheduled tasks." and exited 0.The fix strips the leading backslash before the prefix check. The returned name is the same one
_win_task_name()builds, whichschtasks /delete /tnalready receives in the single-project path.Tests
tests/test_scheduler_windows.pyfeedlist_scheduled()andunschedule(all_projects=True)the CSV format thatschtasksprints. I checked that format against realschtasks /query /fo csvoutput on Windows 11. Both tests fail onmain([] != [...]) and pass with this change.python -m pytest -q tests -k schedulon Windows: 60 passed, 3 skipped.This change was written with Claude Code.
🤖 Generated with Claude Code