Skip to content

[Bug] scheduler.py macOS schedule_create ignores schedule parameter — always uses 3600s interval #424

Description

@vipul674

Describe the bug

In daemon/pilot/system/scheduler.py, the schedule_create function on macOS completely ignores the schedule parameter. The LaunchAgent plist is generated with a hardcoded StartInterval of 3600 seconds (1 hour), regardless of what the user specifies.

The docstring explicitly documents schedule as being valid for all platforms, including macOS (e.g. "0 9 * * *" for daily at 9am), but the macOS code path never parses or uses it.

Steps to reproduce

  1. Call schedule_create("test-task", "/usr/bin/echo hello", "*/5 * * * *") (expects execution every 5 minutes).
  2. On macOS, inspect the generated plist at ~/Library/LaunchAgents/com.pilot.test-task.plist.
  3. Observe that StartInterval is always <integer>3600</integer> regardless of the passed schedule.

Expected behaviour

The schedule parameter should be parsed and mapped to the appropriate LaunchAgent key:

  • For cron expressions with specific intervals, use StartInterval with the correct number of seconds.
  • For calendar-based schedules, use StartCalendarInterval with appropriate <dict> entries.

Actual behaviour

macOS schedule_create hardcodes StartInterval: 3600:

# scheduler.py lines 65-66 — always 3600 seconds
<key>StartInterval</key>
<integer>3600</integer>

Code reference

daemon/pilot/system/scheduler.py:47-76:

elif CURRENT_PLATFORM == Platform.MACOS:
    plist_name = f"com.pilot.{name}"
    plist_path = os.path.expanduser(f"~/Library/LaunchAgents/{plist_name}.plist")

    plist_content = f"""<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>{plist_name}</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/bash</string>
        <string>-c</string>
        <string>{command}</string>
    </array>
    <key>StartInterval</key>
    <integer>3600</integer>     # <-- BUG: schedule variable ignored
</dict>
</plist>"""

Note how name and command are interpolated into the plist, but schedule (the third parameter) is never referenced.

Environment

  • OS: macOS
  • Heliox OS version: Current HEAD

GSSoC 2026 -- This issue is assigned to @vipul674 for implementation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions